Chris Sosa | 5bac949 | 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 | 357deca | 2015-02-07 18:29:32 -0800 | [diff] [blame^] | 12 | env BUFFET_LOG_LEVEL=0 |
| 13 | env BUFFET_STATE_PATH= |
| 14 | env BUFFET_CONFIG_PATH= |
| 15 | |
Alex Vakulenko | f3d77e5 | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 16 | pre-start script |
Anton Muhin | 860e679 | 2014-11-22 05:11:16 +0400 | [diff] [blame] | 17 | mkdir -m 0755 -p /var/lib/buffet |
| 18 | chown -R buffet:buffet /var/lib/buffet |
Alex Vakulenko | f3d77e5 | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 19 | end script |
| 20 | |
Anton Muhin | ecfa00c | 2014-11-20 01:10:08 +0400 | [diff] [blame] | 21 | # Minijail actually forks off our desired process. |
| 22 | expect fork |
| 23 | |
Christopher Wiley | 357deca | 2015-02-07 18:29:32 -0800 | [diff] [blame^] | 24 | exec minijail0 -i -g buffet -u buffet /usr/bin/buffet \ |
| 25 | --v="${BUFFET_LOG_LEVEL}" \ |
| 26 | --config_path="${BUFFET_CONFIG_PATH}" \ |
| 27 | --state_path="${BUFFET_STATE_PATH}" |