blob: e708646b8b67e21d0eaf0b59d5ac71eddad065bf [file] [log] [blame]
# Copyright 2014 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 "Brillo Buffet Service"
author "chromium-os-dev@chromium.org"
# Jetstream devices use BUFFET_CONFIG_PATH to load model id for
# different boards.
import BUFFET_CONFIG_PATH
start on starting system-services
stop on stopping system-services
respawn
env BUFFET_LOG_LEVEL=0
env BUFFET_ENABLE_XMPP=
env BUFFET_STATE_PATH=
env BUFFET_CONFIG_PATH=
env BUFFET_ENABLE_PING=false
env BUFFET_DEVICE_WHITELIST=
env BUFFET_DISABLE_PRIVET=false
env BUFFET_TEST_DEFINITIONS_PATH=
env BUFFET_DISABLE_SECURITY=false
env BUFFET_TEST_PRIVET_SSID=
pre-start script
mkdir -m 0755 -p /var/lib/buffet
chown -R buffet:buffet /var/lib/buffet
end script
# Minijail actually forks off our desired process.
expect fork
exec minijail0 -i -g buffet -u buffet /usr/bin/buffet \
--v="${BUFFET_LOG_LEVEL}" \
--config_path="${BUFFET_CONFIG_PATH}" \
--state_path="${BUFFET_STATE_PATH}" \
--disable_security="${BUFFET_DISABLE_SECURITY}" \
--enable_ping="${BUFFET_ENABLE_PING}" \
--device_whitelist="${BUFFET_DEVICE_WHITELIST}" \
--disable_privet="${BUFFET_DISABLE_PRIVET}" \
--test_definitions_path="${BUFFET_TEST_DEFINITIONS_PATH}" \
--enable_xmpp="${BUFFET_ENABLE_XMPP}" \
--test_privet_ssid="${BUFFET_TEST_PRIVET_SSID}"
# Wait for daemon to claim its D-Bus name before transitioning to started.
post-start exec minijail0 -g buffet -u buffet /usr/bin/gdbus \
wait --system --timeout 30 org.chromium.Buffet