blob: ee18804c89f8c71303be46186676d6bc5c92cb28 [file] [log] [blame]
# Copyright 2018 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 "Clean up the jobs and mount points for the container"
author "chromium-os-dev@chromium.org"
start on start-arc-instance
# use "stopped ui" instead of "stopping ui" to avoid race where
# "arc-setup --mode=stop" runs while run_oci is starting.
stop on stop-arc-instance or stopped ui
pre-start exec logger -t "${UPSTART_JOB}" "Pre-start arc-lifetime"
# This job does not have script/exec stanza, so it is considered running forever
# once started until stopped.
# See: http://upstart.ubuntu.com/cookbook/#jobs-that-run-forever
post-stop script
{
echo "Post-stop arc-lifetime"
set +e -x
stop arc-sdcard
} 2>&1 | logger -t "${UPSTART_JOB}"
exec /usr/sbin/arc-setup --mode=stop "--log_tag=${UPSTART_JOB}"
end script