]> git.pld-linux.org Git - packages/dbus.git/blame - messagebus.init
- updated to 1.2.3; adaptarized
[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
131969d8 37 rm -f /var/run/dbus.pid
954762da 38 daemon /usr/bin/dbus-daemon --system
795a1f31 39 RETVAL=$?
40 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/messagebus
41 else
795a1f31 42 msg_already_running messagebus
43 fi
335bd79c
ER
44}
45
46stop() {
795a1f31 47 if [ -f /var/lock/subsys/messagebus ]; then
48 # Stop daemons.
795a1f31 49 msg_stopping messagebus
6ad30a50 50 killproc --pidfile dbus.pid dbus-daemon
795a1f31 51 rm -f /var/lock/subsys/messagebus
4d374034 52 rm -f /var/run/dbus.pid
795a1f31 53 else
795a1f31 54 msg_not_running messagebus
55 fi
335bd79c
ER
56}
57
6bb5c1d0
JB
58condrestart() {
59 if [ -f /var/lock/subsys/cpqarrayd ]; then
60 stop
61 start
62 else
c8fcbc33 63 msg_not_running messagebus
6bb5c1d0
JB
64 RETVAL=$1
65 fi
66}
67
68RETVAL=0
335bd79c
ER
69# See how we were called.
70case "$1" in
71 start)
72 start
73 ;;
74 stop)
75 stop
795a1f31 76 ;;
77 restart)
335bd79c
ER
78 stop
79 start
795a1f31 80 ;;
6bb5c1d0
JB
81 try-restart)
82 condrestart 0
83 ;;
335bd79c 84 reload|force-reload)
795a1f31 85 if [ -f /var/lock/subsys/messagebus ]; then
795a1f31 86 msg_reloading messagebus
eae213e3 87 killproc dbus-daemon -HUP
795a1f31 88 RETVAL=$?
89 else
2be2ae55 90 msg_not_running messagebus
795a1f31 91 RETVAL=7
92 fi
93 ;;
795a1f31 94 status)
6ad30a50 95 status messagebus dbus-daemon
795a1f31 96 RETVAL=$?
97 ;;
98 *)
6bb5c1d0 99 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
795a1f31 100 exit 3
101esac
102
103exit $RETVAL
This page took 0.104072 seconds and 4 git commands to generate.