| # Copyright 2018 The ChromiumOS Authors | |
| # 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 | |
| # Use 'never' since terminating this job fails ARC to start. | |
| oom score never | |
| 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 exec /usr/sbin/arc-setup --mode=stop "--log_tag=${UPSTART_JOB}" |