| # 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 "cros_ec log concatenator daemon" |
| author "chromium-os-dev@chromium.org" |
| |
| stop on stopping system-services |
| # 69 is EX_UNAVAILABLE which we return if there is no EC log to pull. |
| normal exit 0 69 |
| respawn |
| respawn limit 3 10 # if the job respawns 3 times in 10 seconds, stop trying. |
| |
| # The ecloggers job starts multiple instances of timberslide for |
| # different paths. Import LOG_PATH from the start call. |
| import LOG_PATH |
| export LOG_PATH |
| instance $LOG_PATH |
| |
| script |
| # cros_ec variant name e.g. cros_ec/cros_fp/cros_pd/cros_tp. |
| cros_variant=$(basename $(dirname ${LOG_PATH})) |
| # daemon output logging file. |
| daemon_log=/var/log/timberslide.${cros_variant}.out |
| |
| uptime_file="/sys/kernel/debug/${cros_variant}/uptime" |
| |
| exec timberslide --device_log="${LOG_PATH}" --uptime_file="${uptime_file}" \ |
| >${daemon_log} 2>&1 |
| end script |