]> git.pld-linux.org Git - packages/dbus.git/commitdiff
- init script for dbus
authorgrzegol <grzegol@pld-linux.org>
Sat, 31 Jan 2004 19:13:09 +0000 (19:13 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    messagebus.init -> 1.1

messagebus.init [new file with mode: 0644]

diff --git a/messagebus.init b/messagebus.init
new file mode 100644 (file)
index 0000000..361546b
--- /dev/null
@@ -0,0 +1,97 @@
+#!/bin/sh
+#
+# messagebus   The D-BUS systemwide message bus
+#
+# chkconfig:   345 97 03
+#
+# description: This is a daemon which broadcasts notifications of system
+#              events and other messages.
+#
+
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network ]; then
+               # nls "ERROR: Networking is down. %s can't be run." messagebus
+               msg_network_down messagebus
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+
+# See how we were called.
+case "$1" in
+  start)
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/messagebus ]; then
+               # show "Starting %s service" messagebus
+               msg_starting messagebus
+               daemon dbus-daemon-1 --system
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/messagebus
+       else
+               # show "%s service is already running." messagebus
+               msg_already_running messagebus
+       fi
+       ;;
+  stop)
+       if [ -f /var/lock/subsys/messagebus ]; then
+               # Stop daemons.
+               # show "Stopping %s service" messagebus
+               msg_stopping messagebus
+               killproc dbus-daemon-1
+               rm -f /var/lock/subsys/messagebus
+               rm -f /var/run/dbus/pid
+       else
+               # show "%s service is not running." messagebus
+               msg_not_running messagebus
+       fi
+       ;;
+  restart)
+       $0 stop
+       $0 start
+       exit $?
+       ;;
+  reload)
+       if [ -f /var/lock/subsys/messagebus ]; then
+               # show "Reload %s service" messagebus
+               msg_reloading messagebus
+               killproc dbus-daemon-1 -HUP
+               RETVAL=$?
+       else
+               # show "%s service is not running." messagebus
+               msg_not_running messagebus >&2
+               RETVAL=7
+       fi
+       ;;
+  force-reload)
+       # if program allows reloading without stopping
+       $0 reload
+
+       # or if it doesn't
+       $0 restart
+
+       exit $?
+       ;;
+  status)
+       status messagebus
+       RETVAL=$?
+       ;;
+  *)
+       # show "Usage: %s {start|stop|restart|reload|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+       exit 3
+esac
+
+exit $RETVAL
+
+# This must be last line !
+# vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.028297 seconds and 4 git commands to generate.