blob: 9434255d71026534386cbb7632eca390cbb8c499 [file] [log] [blame]
# Copyright (c) 2010 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.
# cashew upstart job
env CASHEW_LOG_DIR=/var/log/cashew
env CASHEW_LOG_PATTERN=cashewd.*-*
env CASHEW_LOG_RETENTION_DAYS=7
env CASHEW_AGGREGATOR_DIR=/var/db/cashew
start on started flimflam
stop on starting halt or starting reboot
respawn
pre-start script
mkdir -p -m 0755 "${CASHEW_LOG_DIR}"
chown -R cashew:cashew "${CASHEW_LOG_DIR}"
mkdir -p -m 0755 "${CASHEW_AGGREGATOR_DIR}"
chown -R cashew:cashew "${CASHEW_AGGREGATOR_DIR}"
end script
exec /sbin/minijail0 -u cashew -g cashew -- \
/usr/sbin/cashewd --log_dir="${CASHEW_LOG_DIR}" --logbuflevel=-1
post-stop exec find "${CASHEW_LOG_DIR}" -name "${CASHEW_LOG_PATTERN}" \
-mtime +"${CASHEW_LOG_RETENTION_DAYS}" -exec rm '{}' ';'