| # Copyright 2015 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 "Set up the containers directory on the external storage." |
| author "chromium-os-dev@chromium.org" |
| |
| start on stopped moblab-external-storage-init RESULT=ok |
| |
| env CONTAINER_DIR=/mnt/moblab/containers |
| env AUTOTEST_CONTAINER_DIR=/usr/local/autotest/containers |
| |
| normal exit 0 |
| |
| script |
| mkdir -p /var/log/bootup/ |
| exec >>/var/log/bootup/${UPSTART_JOB}.log 2>&1 |
| set -x |
| set -e |
| logger -t "${UPSTART_JOB}" "Starting." |
| mkdir -p "${CONTAINER_DIR}" |
| chown -R moblab:moblab "${CONTAINER_DIR}" || : |
| if [ ! -e "${AUTOTEST_CONTAINER_DIR}" ]; then |
| logger -t "${UPSTART_JOB}" "Creating autotest containers dir symlink." |
| ln -s "${CONTAINER_DIR}" "${AUTOTEST_CONTAINER_DIR}" |
| fi |
| logger -t "${UPSTART_JOB}" "Ending." |
| end script |