-
Notifications
You must be signed in to change notification settings - Fork 48
/
S30dbus
executable file
·63 lines (44 loc) · 1.06 KB
/
S30dbus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
SYS_BTCONF="/etc/bluetooth.conf"
BOOT_BTCONF="/boot/bluetooth.conf"
BTCONF="/data/etc/bluetooth.conf"
CMCONF="/etc/connman/main.conf"
PROG="/usr/bin/dbus-daemon"
PROG_UG="/usr/bin/dbus-uuidgen"
PROG_UA="/usr/bin/udevadm"
test -x ${PROG} || exit 0
# dbus is currently only used by bluez and connman
test -s ${BTCONF} || test -s ${BOOT_BTCONF} || test -s ${SYS_BTCONF} || test -s ${CMCONF} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
start() {
mkdir -p /tmp/dbus
mkdir -p /var/lib/dbus
msg_begin "Starting dbus"
${PROG_UG} --ensure
${PROG} --system
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping dbus"
${PROG_UA} control --stop-exec-queue
killall -q $(basename ${PROG})
test $? == 0 && msg_done || msg_fail
rm -f /var/run/messagebus.pid
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit $?