blob: 7feef4af91820fd6003046919952e99281166886 [file] [log] [blame]
Vitaly Bukacad20f02015-10-16 17:27:15 -07001# Copyright 2015 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
Chris Sosa5bac9492014-03-24 11:18:54 -070014
15description "Brillo Buffet Service"
16author "chromium-os-dev@chromium.org"
17
18start on starting system-services
19stop on stopping system-services
20respawn
21
Christopher Wiley357deca2015-02-07 18:29:32 -080022env BUFFET_LOG_LEVEL=0
Christopher Wiley0714bbe2015-04-07 11:11:18 -070023env BUFFET_ENABLE_XMPP=
Christopher Wiley357deca2015-02-07 18:29:32 -080024env BUFFET_STATE_PATH=
25env BUFFET_CONFIG_PATH=
Vitaly Buka84fd6dd2015-06-09 17:22:18 -070026env BUFFET_ENABLE_PING=false
Vitaly Buka84fd6dd2015-06-09 17:22:18 -070027env BUFFET_DEVICE_WHITELIST=
28env BUFFET_DISABLE_PRIVET=false
Vitaly Buka8b511e92015-07-18 20:43:58 -070029env BUFFET_TEST_DEFINITIONS_PATH=
30env BUFFET_DISABLE_SECURITY=false
31env BUFFET_TEST_PRIVET_SSID=
Christopher Wiley357deca2015-02-07 18:29:32 -080032
Alex Vakulenkof3d77e52014-04-15 11:36:32 -070033pre-start script
Anton Muhin860e6792014-11-22 05:11:16 +040034 mkdir -m 0755 -p /var/lib/buffet
35 chown -R buffet:buffet /var/lib/buffet
Alex Vakulenkof3d77e52014-04-15 11:36:32 -070036end script
37
Anton Muhinecfa00c2014-11-20 01:10:08 +040038# Minijail actually forks off our desired process.
39expect fork
40
Christopher Wiley357deca2015-02-07 18:29:32 -080041exec minijail0 -i -g buffet -u buffet /usr/bin/buffet \
42 --v="${BUFFET_LOG_LEVEL}" \
43 --config_path="${BUFFET_CONFIG_PATH}" \
Christopher Wileyc39f4a32015-02-12 13:42:16 -080044 --state_path="${BUFFET_STATE_PATH}" \
Vitaly Buka84fd6dd2015-06-09 17:22:18 -070045 --disable_security="${BUFFET_DISABLE_SECURITY}" \
46 --enable_ping="${BUFFET_ENABLE_PING}" \
47 --device_whitelist="${BUFFET_DEVICE_WHITELIST}" \
Vitaly Buka8b511e92015-07-18 20:43:58 -070048 --disable_privet="${BUFFET_DISABLE_PRIVET}" \
49 --test_definitions_path="${BUFFET_TEST_DEFINITIONS_PATH}" \
50 --enable_xmpp="${BUFFET_ENABLE_XMPP}" \
51 --test_privet_ssid="${BUFFET_TEST_PRIVET_SSID}"
David Zeuthenf6b9f802015-03-26 12:38:48 -040052
53# Wait for daemon to claim its D-Bus name before transitioning to started.
54post-start exec gdbus wait --system --timeout 30 org.chromium.Buffet