aboutsummaryrefslogtreecommitdiff
path: root/target/device/valka/target_skeleton/etc/rc.d/dbus
blob: 4b81d3c3858b34df64205a3c445c76fb4639aaa5 (plain)
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
#!/bin/sh
. /etc/rc.subr 

start() {
	[ -x /usr/bin/dbus-daemon ] || exit 0
	[ -d /var/run/dbus ] || mkdir -p /var/run/dbus
	[ -d /var/lock/subsys ] || mkdir -p /var/lock/subsys

    echo -n " * Starting dbus: "

    dbus-uuidgen --ensure
    dbus-daemon --system
    RETVAL=$?
    echo "Ok"
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dbus-daemon
}

stop() {
    echo -n " * Stopping dbus: "

    killall dbus-daemon
    RETVAL=$?
    echo "Ok"
    if [ $RETVAL -eq 0 ]; then
        rm -f /var/lock/subsys/dbus-daemon
        rm -f /var/run/messagebus.pid
    fi
}

rc_run_command "$1" "dbus"