blob: bc73aec1576a8b9dc19e84304182e20d9d27314f [file] [log] [blame]
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# 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.
# Existing mounts are cleaned up once ui is stopped: see
# imageloader-shutdown.conf.
stop on 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
# Check if the ui job is still running before starting imageloader.
# This is to prevent new dbus-activated instances from getting started once the
# system is starting shutdown.
pre-start script
if ! initctl status ui | grep -q running; then
stop
exit 0
fi
end script
# 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