]> git.pld-linux.org Git - packages/dbus.git/blame - messagebus.init
- rel 7
[packages/dbus.git] / messagebus.init
CommitLineData
ce7839f4 1#!/bin/sh
2#
3# messagebus The D-BUS systemwide message bus
4#
5# chkconfig: 345 22 85
6#
7# description: This is a daemon which broadcasts notifications of system
8# events and other messages.
9#
10# pidfile: /var/run/dbus.pid
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
21 msg_network_down messagebus
22 exit 1
23 fi
24else
25 exit 0
26fi
27
28start() {
29 # Check if the service is already running?
30 if [ ! -f /var/lock/subsys/messagebus ]; then
31 msg_starting messagebus
32 daemon dbus-daemon --system
33 RETVAL=$?
34 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/messagebus
35 else
36 msg_already_running messagebus
37 fi
38}
39
40stop() {
41 if [ -f /var/lock/subsys/messagebus ]; then
42 # Stop daemons.
43 msg_stopping messagebus
44 killproc --pidfile dbus.pid dbus-daemon
45 rm -f /var/lock/subsys/messagebus
46 rm -f /var/run/dbus.pid
47 else
48 msg_not_running messagebus
49 fi
50}
51
52# See how we were called.
53case "$1" in
54 start)
55 start
56 ;;
57 stop)
58 stop
59 ;;
60 restart)
61 stop
62 start
63 ;;
64 reload|force-reload)
65 if [ -f /var/lock/subsys/messagebus ]; then
66 msg_reloading messagebus
67 killproc dbus-daemon -HUP
68 RETVAL=$?
69 else
70 msg_not_running messagebus
71 RETVAL=7
72 fi
73 ;;
74 status)
75 status messagebus dbus-daemon
76 RETVAL=$?
77 ;;
78 *)
79 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
80 exit 3
81esac
82
83exit $RETVAL
84
85# This must be last line !
This page took 0.084092 seconds and 4 git commands to generate.