blob: ba4adb2e09af942aff4b055186a098026dbb6da5 [file] [log] [blame]
Chris Sosa45d9f102014-03-24 11:18:54 -07001# 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
5description "Brillo Buffet Service"
6author "chromium-os-dev@chromium.org"
7
8start on starting system-services
9stop on stopping system-services
10respawn
11
Christopher Wileye0fdeee2015-02-07 18:29:32 -080012env BUFFET_LOG_LEVEL=0
Christopher Wiley3bbb62d2015-04-07 11:11:18 -070013env BUFFET_ENABLE_XMPP=
Christopher Wileye0fdeee2015-02-07 18:29:32 -080014env BUFFET_STATE_PATH=
15env BUFFET_CONFIG_PATH=
Christopher Wileybb5b8482015-02-12 13:42:16 -080016env BUFFET_TEST_DEFINITIONS_PATH=
Christopher Wileye0fdeee2015-02-07 18:29:32 -080017
Alex Vakulenko3cb466c2014-04-15 11:36:32 -070018pre-start script
Anton Muhin2a9d63d2014-11-22 05:11:16 +040019 mkdir -m 0755 -p /var/lib/buffet
20 chown -R buffet:buffet /var/lib/buffet
Alex Vakulenko3cb466c2014-04-15 11:36:32 -070021end script
22
Anton Muhin1738fbe2014-11-20 01:10:08 +040023# Minijail actually forks off our desired process.
24expect fork
25
Christopher Wileye0fdeee2015-02-07 18:29:32 -080026exec minijail0 -i -g buffet -u buffet /usr/bin/buffet \
27 --v="${BUFFET_LOG_LEVEL}" \
28 --config_path="${BUFFET_CONFIG_PATH}" \
Christopher Wileybb5b8482015-02-12 13:42:16 -080029 --state_path="${BUFFET_STATE_PATH}" \
Christopher Wiley3bbb62d2015-04-07 11:11:18 -070030 --test_definitions_path="${BUFFET_TEST_DEFINITIONS_PATH}" \
31 --enable_xmpp="${BUFFET_ENABLE_XMPP}"
David Zeuthen70564342015-03-26 12:38:48 -040032
33# Wait for daemon to claim its D-Bus name before transitioning to started.
34post-start exec gdbus wait --system --timeout 30 org.chromium.Buffet