]> git.pld-linux.org Git - packages/dbus.git/blame - messagebus.init
- 0.92, moved configuration to /etc/sysconfig/messagebus (to make use of
[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
28
29# See how we were called.
30case "$1" in
31 start)
32 # Check if the service is already running?
33 if [ ! -f /var/lock/subsys/messagebus ]; then
795a1f31 34 msg_starting messagebus
eae213e3 35 daemon dbus-daemon --system
795a1f31 36 RETVAL=$?
37 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/messagebus
38 else
795a1f31 39 msg_already_running messagebus
40 fi
41 ;;
42 stop)
43 if [ -f /var/lock/subsys/messagebus ]; then
44 # Stop daemons.
795a1f31 45 msg_stopping messagebus
6ad30a50 46 killproc --pidfile dbus.pid dbus-daemon
795a1f31 47 rm -f /var/lock/subsys/messagebus
4d374034 48 rm -f /var/run/dbus.pid
795a1f31 49 else
795a1f31 50 msg_not_running messagebus
51 fi
52 ;;
53 restart)
54 $0 stop
55 $0 start
56 exit $?
57 ;;
58 reload)
59 if [ -f /var/lock/subsys/messagebus ]; then
795a1f31 60 msg_reloading messagebus
eae213e3 61 killproc dbus-daemon -HUP
795a1f31 62 RETVAL=$?
63 else
795a1f31 64 msg_not_running messagebus >&2
65 RETVAL=7
66 fi
67 ;;
68 force-reload)
69 # if program allows reloading without stopping
70 $0 reload
71
72 # or if it doesn't
73 $0 restart
74
75 exit $?
76 ;;
77 status)
6ad30a50 78 status messagebus dbus-daemon
795a1f31 79 RETVAL=$?
80 ;;
81 *)
795a1f31 82 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
83 exit 3
84esac
85
86exit $RETVAL
87
88# This must be last line !
89# vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.275723 seconds and 4 git commands to generate.