| # Copyright 2021 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. |
| |
| # TODO (prasadv): Make a generic upscript for moblab and satlab |
| |
| description "Safely stop all the docker conatiners." |
| author "chromium-os-dev@chromium.org" |
| |
| start on starting pre-shutdown |
| |
| task |
| |
| script |
| mkdir -p /var/log/bootup/ |
| exec >>/var/log/bootup/${UPSTART_JOB}.log 2>&1 |
| set -x |
| set +e |
| |
| APP_KEY="$(vpd -i RW_VPD -g application)" |
| if [ "$?" != "0" ] || [ "${APP_KEY}" != "satlab" ]; then |
| echo "Cannot start ${UPSTART_JOB} for APP_KEY = ${APP_KEY}." |
| exit 1 |
| fi |
| |
| set -e |
| docker exec -i compose /compose_startup.sh down |
| docker stop compose |
| docker stop dhcp |
| end script |