Annotation of /trunk/dbus/dbus.rc-1.0
Parent Directory | Revision Log
Revision 85 -
(hide annotations)
(download)
Sat Nov 25 11:25:21 2006 UTC (17 years, 10 months ago) by niro
File size: 1351 byte(s)
Sat Nov 25 11:25:21 2006 UTC (17 years, 10 months ago) by niro
File size: 1351 byte(s)
new dbus init for dbus >= .10
1 | niro | 85 | #!/bin/bash |
2 | # $Header: /root/magellan-cvs/src/dbus/dbus.rc-1.0,v 1.1 2006-11-25 11:25:21 niro Exp $ | ||
3 | |||
4 | #%rlevels: 0:k 1:k 6:k 7:s | ||
5 | #%start: 58 | ||
6 | #%stop: 50 | ||
7 | |||
8 | #deps | ||
9 | #%needs: | ||
10 | #%before: | ||
11 | #%after: | ||
12 | |||
13 | source /etc/sysconfig/rc | ||
14 | source $rc_functions | ||
15 | |||
16 | |||
17 | case "$1" in | ||
18 | start) | ||
19 | echo -e ${COLOREDSTAR}"Starting D-BUS system messagebus ..." | ||
20 | /usr/bin/dbus-uuidgen --ensure | ||
21 | |||
22 | # run state must exists | ||
23 | [[ ! -e /var/run/dbus ]] && mkdir /var/run/dbus | ||
24 | |||
25 | start-stop-daemon \ | ||
26 | --start \ | ||
27 | --pidfile /var/run/dbus.pid \ | ||
28 | --exec /usr/bin/dbus-daemon -- --system | ||
29 | evaluate_retval | ||
30 | splash svc_started splash 0 | ||
31 | ;; | ||
32 | |||
33 | stop) | ||
34 | echo -e ${COLOREDSTAR}"Stopping D-BUS system messagebus ..." | ||
35 | start-stop-daemon --stop --pidfile /var/run/dbus.pid | ||
36 | evaluate_retval | ||
37 | |||
38 | # remove pid file if exist | ||
39 | [[ -f /var/run/dbus.pid ]] && rm /var/run/dbus.pid | ||
40 | |||
41 | # remose system socket if exist | ||
42 | [[ -S /var/run/dbus/system_bus_socket ]] && rm -f /var/run/dbus/system_bus_socket | ||
43 | |||
44 | splash svc_stopped splash 0 | ||
45 | ;; | ||
46 | |||
47 | reload) | ||
48 | echo -e ${COLOREDSTAR}"Reloading D-BUS configuration ..." | ||
49 | /usr/bin/dbus-send \ | ||
50 | --print-reply \ | ||
51 | --system \ | ||
52 | --type=method_call \ | ||
53 | --dest=org.freedesktop.DBus \ | ||
54 | / org.freedesktop.DBus.ReloadConfig > /dev/null | ||
55 | evaluate_retval | ||
56 | ;; | ||
57 | |||
58 | restart) | ||
59 | $0 stop | ||
60 | sleep 1 | ||
61 | $0 start | ||
62 | ;; | ||
63 | |||
64 | *) | ||
65 | echo "Usage: $0 {start|stop|reload|restart}" | ||
66 | exit 1 | ||
67 | ;; | ||
68 | esac |