]> git.pld-linux.org Git - packages/dbus.git/blame - messagebus.init
- 1.0.1
[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
000b5b5b 32 dbus-uuidgen --ensure
eae213e3 33 daemon dbus-daemon --system
795a1f31 34 RETVAL=$?
35 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/messagebus
36 else
795a1f31 37 msg_already_running messagebus
38 fi
335bd79c
ER
39}
40
41stop() {
795a1f31 42 if [ -f /var/lock/subsys/messagebus ]; then
43 # Stop daemons.
795a1f31 44 msg_stopping messagebus
6ad30a50 45 killproc --pidfile dbus.pid dbus-daemon
795a1f31 46 rm -f /var/lock/subsys/messagebus
4d374034 47 rm -f /var/run/dbus.pid
795a1f31 48 else
795a1f31 49 msg_not_running messagebus
50 fi
335bd79c
ER
51}
52
53# See how we were called.
54case "$1" in
55 start)
56 start
57 ;;
58 stop)
59 stop
795a1f31 60 ;;
61 restart)
335bd79c
ER
62 stop
63 start
795a1f31 64 ;;
335bd79c 65 reload|force-reload)
795a1f31 66 if [ -f /var/lock/subsys/messagebus ]; then
795a1f31 67 msg_reloading messagebus
eae213e3 68 killproc dbus-daemon -HUP
795a1f31 69 RETVAL=$?
70 else
2be2ae55 71 msg_not_running messagebus
795a1f31 72 RETVAL=7
73 fi
74 ;;
795a1f31 75 status)
6ad30a50 76 status messagebus dbus-daemon
795a1f31 77 RETVAL=$?
78 ;;
79 *)
795a1f31 80 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
81 exit 3
82esac
83
84exit $RETVAL
85
86# This must be last line !
This page took 0.094252 seconds and 4 git commands to generate.