blob: 24e570d9ded028ec782f0ac76b8bec4ec54cf7de [file] [log] [blame] [edit]
# Copyright 2020 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
description "Chrome OS Image Loader Service"
author "chromium-os-dev@chromium.org"
# This is started by D-Bus service activation through
# org.chromium.Imageloader.service.
# Stop service when imageloader-shutdown is starting.
# Ideally startup should also be blocked during shutdown, but stopping
# during a imageloader-shutdown stanza covers most use cases.
# The stop during stopping of ui is added as that indicates a session change.
# (Rather than depending on `logout`, `ui` is used as that's what `logout`
# depends on for state change)
stop on starting imageloader-shutdown or stopping ui
# Allow us to be killed as we are not critical to the system. If we have a
# leak, better to crash & restart than to OOM-panic the system.
oom score -100
# Start imageloader.
exec /usr/sbin/imageloader
# Wait for daemon to claim its D-Bus name before transitioning to started.
post-start exec minijail0 -u imageloaderd -g imageloaderd /usr/bin/gdbus \
wait --system --timeout 15 org.chromium.ImageLoader