OLD | NEW |
1 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # dbus | 5 # dbus |
6 # | 6 # |
7 # Does some required setup and then starts the D-Bus daemon. | 7 # Does some required setup and then starts the D-Bus daemon. |
8 # | 8 # |
9 | 9 |
10 start on runlevel 2 | 10 start on runlevel 2 |
11 respawn | 11 respawn |
12 | 12 |
13 # Sets up the D-Bus environment. | 13 # Sets up the D-Bus environment. |
14 pre-start script | 14 pre-start script |
15 mkdir -p /var/run/dbus | 15 mkdir -p /var/run/dbus |
16 chown messagebus.messagebus /var/run/dbus | 16 chown messagebus.messagebus /var/run/dbus |
| 17 if [ ! -f "/var/cache/machine-id" ]; then |
| 18 dbus-uuidgen --ensure=/var/cache/machine-id |
| 19 fi |
17 end script | 20 end script |
18 | 21 |
19 expect fork | 22 expect fork |
20 exec /bin/dbus-daemon --system --fork | 23 exec /bin/dbus-daemon --system --fork |
21 | 24 |
22 # The post-stop script will clean up after d-dbus. It's better to put this | 25 # The post-stop script will clean up after d-dbus. It's better to put this |
23 # here rather than in pre-start since post-stop is always guaranteed to run | 26 # here rather than in pre-start since post-stop is always guaranteed to run |
24 # while pre-start can exit pre-maturely. | 27 # while pre-start can exit pre-maturely. |
25 post-stop script | 28 post-stop script |
26 rm -rf /var/run/dbus | 29 rm -rf /var/run/dbus |
27 end script | 30 end script |
OLD | NEW |