| # 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 "Start the server proxy for arcvm" |
| author "chromium-os-dev@chromium.org" |
| |
| start on started arcvm |
| stop on stopping arcvm |
| |
| env FILESYSTEM_MOUNT_PATH="/run/arc/server_proxy" |
| |
| pre-start script |
| logger -t "${UPSTART_JOB}" "Pre-start arcvm-server-proxy" |
| |
| # TODO(hidehiko): Set up minijail with mount namespace. |
| mkdir -p "${FILESYSTEM_MOUNT_PATH}" |
| |
| # Make sure the vsock module is loaded. |
| exec modprobe -q vhost-vsock |
| end script |
| |
| exec arcvm_server_proxy "${FILESYSTEM_MOUNT_PATH}" |
| |
| post-stop script |
| logger -t "${UPSTART_JOB}" "Post-stop arcvm-server-proxy" |
| exec umount -l "${FILESYSTEM_MOUNT_PATH}" |
| end script |