Chris Sosa | 45d9f10 | 2014-03-24 11:18:54 -0700 | [diff] [blame] | 1 | # Copyright 2014 The Chromium OS Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | description "Brillo Buffet Service" |
| 6 | author "chromium-os-dev@chromium.org" |
| 7 | |
| 8 | start on starting system-services |
| 9 | stop on stopping system-services |
| 10 | respawn |
| 11 | |
Christopher Wiley | e0fdeee | 2015-02-07 18:29:32 -0800 | [diff] [blame] | 12 | env BUFFET_LOG_LEVEL=0 |
Christopher Wiley | 3bbb62d | 2015-04-07 11:11:18 -0700 | [diff] [blame] | 13 | env BUFFET_ENABLE_XMPP= |
Christopher Wiley | e0fdeee | 2015-02-07 18:29:32 -0800 | [diff] [blame] | 14 | env BUFFET_STATE_PATH= |
| 15 | env BUFFET_CONFIG_PATH= |
Christopher Wiley | bb5b848 | 2015-02-12 13:42:16 -0800 | [diff] [blame] | 16 | env BUFFET_TEST_DEFINITIONS_PATH= |
Christopher Wiley | e0fdeee | 2015-02-07 18:29:32 -0800 | [diff] [blame] | 17 | |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 18 | pre-start script |
Anton Muhin | 2a9d63d | 2014-11-22 05:11:16 +0400 | [diff] [blame] | 19 | mkdir -m 0755 -p /var/lib/buffet |
| 20 | chown -R buffet:buffet /var/lib/buffet |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 21 | end script |
| 22 | |
Anton Muhin | 1738fbe | 2014-11-20 01:10:08 +0400 | [diff] [blame] | 23 | # Minijail actually forks off our desired process. |
| 24 | expect fork |
| 25 | |
Christopher Wiley | e0fdeee | 2015-02-07 18:29:32 -0800 | [diff] [blame] | 26 | exec minijail0 -i -g buffet -u buffet /usr/bin/buffet \ |
| 27 | --v="${BUFFET_LOG_LEVEL}" \ |
| 28 | --config_path="${BUFFET_CONFIG_PATH}" \ |
Christopher Wiley | bb5b848 | 2015-02-12 13:42:16 -0800 | [diff] [blame] | 29 | --state_path="${BUFFET_STATE_PATH}" \ |
Christopher Wiley | 3bbb62d | 2015-04-07 11:11:18 -0700 | [diff] [blame] | 30 | --test_definitions_path="${BUFFET_TEST_DEFINITIONS_PATH}" \ |
| 31 | --enable_xmpp="${BUFFET_ENABLE_XMPP}" |
David Zeuthen | 7056434 | 2015-03-26 12:38:48 -0400 | [diff] [blame] | 32 | |
| 33 | # Wait for daemon to claim its D-Bus name before transitioning to started. |
| 34 | post-start exec gdbus wait --system --timeout 30 org.chromium.Buffet |