| # 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 "Daemon for writing disk images to USB sticks & SD cards" |
| author "chromium-os-dev@chromium.org" |
| |
| # This daemon is started by D-Bus service activation configured in |
| # org.chromium.ImageBurner.service. |
| stop on stopping ui |
| |
| pre-start script |
| # Check if ui is still running before starting image-burner |
| # This is to prevent new dbus-activated instances from getting started once |
| # the system is beginning to shut down. |
| if ! initctl status ui | grep -q running; then |
| stop |
| exit 0 |
| fi |
| end script |
| |
| exec /usr/sbin/image_burner |
| |
| # Wait for daemon to claim its D-Bus name before transitioning to started. |
| post-start exec minijail0 -u chronos -g chronos /usr/bin/gdbus \ |
| wait --system --timeout 15 org.chromium.ImageBurner |