| # 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 "Log all the moblab upstart events to aid debugging." |
| author "chromium-os-dev@chromium.org" |
| |
| start on (starting moblab* or |
| started moblab* or |
| stopping moblab* or |
| stopped moblab*) |
| |
| normal exit 0 |
| |
| script |
| mkdir -p /var/log/bootup/ |
| exec >>/var/log/bootup/${UPSTART_JOB}.log 2>&1 |
| log="$JOB\t\t\tevent(s) ${UPSTART_EVENTS}" |
| if [ "${RESULT}" = "failed" ]; then |
| log="${log} process $PROCESS" |
| fi |
| if [ -n "${RESULT}" ]; then |
| log="${log} result $RESULT" |
| fi |
| if [ -n "${EXIT_STATUS}" ]; then |
| log="${log} exit_code $EXIT_STATUS" |
| fi |
| if [ -n "${EXIT_SIGNAL}" ]; then |
| log="${log} exit_signal $EXIT_SIGNAL" |
| fi |
| echo -e "${log}" |
| end script |