Vitaly Buka | cad20f0 | 2015-10-16 17:27:15 -0700 | [diff] [blame] | 1 | # 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 Sosa | 5bac949 | 2014-03-24 11:18:54 -0700 | [diff] [blame] | 14 | |
| 15 | description "Brillo Buffet Service" |
| 16 | author "chromium-os-dev@chromium.org" |
| 17 | |
| 18 | start on starting system-services |
| 19 | stop on stopping system-services |
| 20 | respawn |
| 21 | |
Christopher Wiley | 357deca | 2015-02-07 18:29:32 -0800 | [diff] [blame] | 22 | env BUFFET_LOG_LEVEL=0 |
Christopher Wiley | 0714bbe | 2015-04-07 11:11:18 -0700 | [diff] [blame] | 23 | env BUFFET_ENABLE_XMPP= |
Christopher Wiley | 357deca | 2015-02-07 18:29:32 -0800 | [diff] [blame] | 24 | env BUFFET_STATE_PATH= |
| 25 | env BUFFET_CONFIG_PATH= |
Vitaly Buka | 84fd6dd | 2015-06-09 17:22:18 -0700 | [diff] [blame] | 26 | env BUFFET_ENABLE_PING=false |
Vitaly Buka | 84fd6dd | 2015-06-09 17:22:18 -0700 | [diff] [blame] | 27 | env BUFFET_DEVICE_WHITELIST= |
| 28 | env BUFFET_DISABLE_PRIVET=false |
Vitaly Buka | 8b511e9 | 2015-07-18 20:43:58 -0700 | [diff] [blame] | 29 | env BUFFET_TEST_DEFINITIONS_PATH= |
| 30 | env BUFFET_DISABLE_SECURITY=false |
| 31 | env BUFFET_TEST_PRIVET_SSID= |
Christopher Wiley | 357deca | 2015-02-07 18:29:32 -0800 | [diff] [blame] | 32 | |
Alex Vakulenko | f3d77e5 | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 33 | pre-start script |
Anton Muhin | 860e679 | 2014-11-22 05:11:16 +0400 | [diff] [blame] | 34 | mkdir -m 0755 -p /var/lib/buffet |
| 35 | chown -R buffet:buffet /var/lib/buffet |
Alex Vakulenko | f3d77e5 | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 36 | end script |
| 37 | |
Anton Muhin | ecfa00c | 2014-11-20 01:10:08 +0400 | [diff] [blame] | 38 | # Minijail actually forks off our desired process. |
| 39 | expect fork |
| 40 | |
Christopher Wiley | 357deca | 2015-02-07 18:29:32 -0800 | [diff] [blame] | 41 | exec minijail0 -i -g buffet -u buffet /usr/bin/buffet \ |
| 42 | --v="${BUFFET_LOG_LEVEL}" \ |
| 43 | --config_path="${BUFFET_CONFIG_PATH}" \ |
Christopher Wiley | c39f4a3 | 2015-02-12 13:42:16 -0800 | [diff] [blame] | 44 | --state_path="${BUFFET_STATE_PATH}" \ |
Vitaly Buka | 84fd6dd | 2015-06-09 17:22:18 -0700 | [diff] [blame] | 45 | --disable_security="${BUFFET_DISABLE_SECURITY}" \ |
| 46 | --enable_ping="${BUFFET_ENABLE_PING}" \ |
| 47 | --device_whitelist="${BUFFET_DEVICE_WHITELIST}" \ |
Vitaly Buka | 8b511e9 | 2015-07-18 20:43:58 -0700 | [diff] [blame] | 48 | --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 Zeuthen | f6b9f80 | 2015-03-26 12:38:48 -0400 | [diff] [blame] | 52 | |
| 53 | # Wait for daemon to claim its D-Bus name before transitioning to started. |
| 54 | post-start exec gdbus wait --system --timeout 30 org.chromium.Buffet |