]> git.pld-linux.org Git - packages/dbus.git/blame - messagebus.init
- updated for 1.2.20
[packages/dbus.git] / messagebus.init
CommitLineData
795a1f31 1#!/bin/sh
2#
3# messagebus The D-BUS systemwide message bus
4#
730764e7 5# chkconfig: 345 22 85
795a1f31 6#
7# description: This is a daemon which broadcasts notifications of system
8# events and other messages.
9#
4d374034 10# pidfile: /var/run/dbus.pid
795a1f31 11
12# Source function library
13. /etc/rc.d/init.d/functions
14
15# Get network config
16. /etc/sysconfig/network
17
18# Check that networking is up.
19if is_yes "${NETWORKING}"; then
20 if [ ! -f /var/lock/subsys/network ]; then
795a1f31 21 msg_network_down messagebus
22 exit 1
23 fi
24else
25 exit 0
26fi
27
335bd79c 28start() {
795a1f31 29 # Check if the service is already running?
30 if [ ! -f /var/lock/subsys/messagebus ]; then
795a1f31 31 msg_starting messagebus
a27a848d
ER
32 # if capability is modular, load it
33 if modinfo capability >/dev/null 2>&1; then
34 modprobe -s capability
35 fi
000b5b5b 36 dbus-uuidgen --ensure
3460cdb1 37 daemon --pidfile dbus.pid /usr/bin/dbus-daemon --system
795a1f31 38 RETVAL=$?
39 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/messagebus
40 else
795a1f31 41 msg_already_running messagebus
42 fi
335bd79c
ER
43}
44
45stop() {
795a1f31 46 if [ -f /var/lock/subsys/messagebus ]; then
47 # Stop daemons.
795a1f31 48 msg_stopping messagebus
6ad30a50 49 killproc --pidfile dbus.pid dbus-daemon
795a1f31 50 rm -f /var/lock/subsys/messagebus
4d374034 51 rm -f /var/run/dbus.pid
795a1f31 52 else
795a1f31 53 msg_not_running messagebus
54 fi
335bd79c
ER
55}
56
6bb5c1d0
JB
57condrestart() {
58 if [ -f /var/lock/subsys/cpqarrayd ]; then
59 stop
60 start
61 else
c8fcbc33 62 msg_not_running messagebus
6bb5c1d0
JB
63 RETVAL=$1
64 fi
65}
66
67RETVAL=0
335bd79c
ER
68# See how we were called.
69case "$1" in
70 start)
71 start
72 ;;
73 stop)
74 stop
795a1f31 75 ;;
76 restart)
335bd79c
ER
77 stop
78 start
795a1f31 79 ;;
6bb5c1d0
JB
80 try-restart)
81 condrestart 0
82 ;;
335bd79c 83 reload|force-reload)
795a1f31 84 if [ -f /var/lock/subsys/messagebus ]; then
795a1f31 85 msg_reloading messagebus
eae213e3 86 killproc dbus-daemon -HUP
795a1f31 87 RETVAL=$?
88 else
2be2ae55 89 msg_not_running messagebus
795a1f31 90 RETVAL=7
91 fi
92 ;;
795a1f31 93 status)
6ad30a50 94 status messagebus dbus-daemon
795a1f31 95 RETVAL=$?
96 ;;
97 *)
6bb5c1d0 98 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
795a1f31 99 exit 3
100esac
101
102exit $RETVAL
This page took 0.150183 seconds and 4 git commands to generate.