2004-10-29 Colin Walters <walters@redhat.com>
authorColin Walters <walters@verbum.org>
Fri, 29 Oct 2004 19:17:57 +0000 (19:17 +0000)
committerColin Walters <walters@verbum.org>
Fri, 29 Oct 2004 19:17:57 +0000 (19:17 +0000)
Patch from Kristof Vansant <de_lupus@pandora.be>

* configure.in: Detect Slackware.
* bus/Makefile.am (SCRIPT_IN_FILES): Add rc.messagebus.in.
* bus/rc.messagebus.in: New file.

ChangeLog
bus/Makefile.am
bus/rc.messagebus.in [new file with mode: 0644]
configure.in

index 7e2562f..8d117d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2004-10-29  Colin Walters  <walters@redhat.com>
 
+       Patch from Kristof Vansant <de_lupus@pandora.be>
+
+       * configure.in: Detect Slackware.
+       * bus/Makefile.am (SCRIPT_IN_FILES): Add rc.messagebus.in.
+       * bus/rc.messagebus.in: New file.
+
+2004-10-29  Colin Walters  <walters@redhat.com>
+
        * tools/dbus-monitor.c (filter_func): Return
        DBUS_HANDLER_RESULT_HANDLED in filter function
        for now.  See:
index 218c6a5..f6e03d7 100644 (file)
@@ -95,7 +95,8 @@ install-data-hook:
        $(mkinstalldirs) $(DESTDIR)/$(datadir)/dbus-1/services
 
 #### Init scripts fun
-SCRIPT_IN_FILES=messagebus.in
+SCRIPT_IN_FILES=messagebus.in \
+               rc.messagebus.in
 
 ## Red Hat start
 if DBUS_INIT_SCRIPTS_RED_HAT
@@ -107,6 +108,17 @@ initd_SCRIPTS=     \
 
 endif
  ## Red Hat end
+## Slackware start
+if DBUS_INIT_SCRIPTS_SLACKWARE
+
+initddir=$(sysconfdir)/rc.d/
+
+initd_SCRIPTS=         \
+       rc.messagebus
+
+endif
+## Slackware end
 
 MAN_IN_FILES=dbus-daemon-1.1.in
 man_MANS = dbus-daemon-1.1
diff --git a/bus/rc.messagebus.in b/bus/rc.messagebus.in
new file mode 100644 (file)
index 0000000..4214a9f
--- /dev/null
@@ -0,0 +1,75 @@
+#!/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. See http://www.freedesktop.org/software/dbus/
+#
+# processname: dbus-daemon-1
+# pidfile: @DBUS_SYSTEM_PID_FILE@
+#
+
+# Sanity checks.
+#[ -x @EXPANDED_BINDIR@/dbus-daemon-1 ] || exit 0
+
+# Source function library.
+#. @EXPANDED_SYSCONFDIR@/rc.d/init.d/functions
+
+# so we can rearrange this easily
+#processname=dbus-daemon-1
+#servicename=messagebus
+
+#RETVAL=0
+
+start() {
+    echo "Starting system message bus"
+    if [ -x @EXPANDED_BINDIR@/dbus-daemon-1 ];then
+       @EXPANDED_BINDIR@/dbus-daemon-1 --system
+    fi
+    #daemon --check $servicename $processname --system
+    #RETVAL=$?
+    #echo
+    #[ $RETVAL -eq 0 ] && touch @EXPANDED_LOCALSTATEDIR@/lock/subsys/$servicename
+}
+
+stop() {
+    echo "Stopping system message bus"
+
+    ## we don't want to kill all the per-user $processname, we want
+    ## to use the pid file *only*; because we use the fake nonexistent 
+    ## program name "$servicename" that should be safe-ish
+    killall dbus-daemon-1
+    #RETVAL=$?
+    #echo
+    #if [ $RETVAL -eq 0 ]; then
+    #    rm -f @EXPANDED_LOCALSTATEDIR@/lock/subsys/$servicename
+    #    rm -f @DBUS_SYSTEM_PID_FILE@
+    #fi
+}
+
+# See how we were called.
+case "$1" in
+    start)
+        start
+        ;;
+    stop)
+        stop
+        ;;
+    status)
+        status $processname
+        RETVAL=$?
+        ;;
+    restart)
+        stop
+        start
+        ;;
+    reload)
+        echo "Message bus can't reload its configuration, you have to restart it"
+        RETVAL=$?
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|reload}"
+        ;;
+esac
+exit $RETVAL
index e9c6c10..dcb8d45 100644 (file)
@@ -998,18 +998,27 @@ if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ;
    operating_system=redhat
 fi
 
+if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
+   operating_system=slackware
+fi
+
 #### Sort out init scripts
 
 if test x$with_init_scripts = x; then
     if test xredhat = x$operating_system ; then
         with_init_scripts=redhat
     else
-        with_init_scripts=none
+        if test xslackware = x$operating_system ; then
+               with_init_scripts=slackware
+           else
+               with_init_scripts=none
+        fi
     fi
 fi
 
 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
 
+AM_CONDITIONAL(DBUS_INIT_SCRIPTS_SLACKWARE, test x$with_init_scripts = xslackware)
 
 ##### Set up location for system bus socket
 if ! test -z "$with_system_socket"; then
@@ -1126,6 +1135,7 @@ dbus/dbus-arch-deps.h
 bus/system.conf
 bus/session.conf
 bus/messagebus
+bus/rc.messagebus
 bus/dbus-daemon-1.1
 Makefile
 dbus/Makefile