blob: 8292b42ebab97f4e64ed2fa760a21b5120ab6a62 [file] [log] [blame]
# 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 "Starts a command for reading from the kmsg FIFO."
author "chromium-os-dev@chromium.org"
stop on stop-arc-instance or stopping ui
script
logger -t "${UPSTART_JOB}" "Start arc-kmsg-logger"
while true ; do
# If logger fails, terminate the job. If it exits with 0 on EOF, respawn
# the process after a short sleep.
sudo -u android-root \
logger -t "${UPSTART_JOB}" --file /run/arc/android.kmsg.fifo
logger -t "${UPSTART_JOB}" "EOF detected, restarting"
sleep 1
done
end script
post-stop exec logger -t "${UPSTART_JOB}" "Post-stop arc-kmsg-logger"