blob: 7feef4af91820fd6003046919952e99281166886 [file] [log] [blame]
# Copyright 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
description "Brillo Buffet Service"
author "chromium-os-dev@chromium.org"
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 gdbus wait --system --timeout 30 org.chromium.Buffet