[csw-devel] SF.net SVN: gar:[15320] csw/mgar/pkg/dbus/trunk/files/cswdbus

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Fri Aug 12 12:19:02 CEST 2011


Revision: 15320
          http://gar.svn.sourceforge.net/gar/?rev=15320&view=rev
Author:   dmichelsen
Date:     2011-08-12 10:19:02 +0000 (Fri, 12 Aug 2011)

Log Message:
-----------
dbus: Fix init script

Modified Paths:
--------------
    csw/mgar/pkg/dbus/trunk/files/cswdbus

Modified: csw/mgar/pkg/dbus/trunk/files/cswdbus
===================================================================
--- csw/mgar/pkg/dbus/trunk/files/cswdbus	2011-08-12 09:48:09 UTC (rev 15319)
+++ csw/mgar/pkg/dbus/trunk/files/cswdbus	2011-08-12 10:19:02 UTC (rev 15320)
@@ -6,7 +6,9 @@
 #RC_SLEV 3          # Run levels that should have a start script symlink
 #FMRI system        # FMRI path for service (S10+), default is /network.
 
-. /lib/svc/share/smf_include.sh
+if [ -f /lib/svc/share/smf_include.sh ]; then
+  . /lib/svc/share/smf_include.sh
+fi
 
 DBUS_VAR_DIR=/var/opt/csw/lib/dbus
 DBUS_VAR_RUN_DIR=/var/opt/csw/run/dbus
@@ -16,23 +18,29 @@
     mkdir -p $DBUS_VAR_DIR
 fi
 
-if [ ! -f $DBUS_VAR_DIR/$DBUS_MACHINE_ID_FILE ]; then
-    /opt/csw/bin/dbus-uuidgen --ensure
-fi
-
-if smf_is_nonglobalzone; then
+if test "`uname -r`" = "5.10" && smf_is_nonglobalzone; then
        /usr/sbin/svcadm disable -t svc:/system/cswdbus
        echo "dbus-daemon cannot be run in non-global zones"
        sleep 5 &
        exit $SMF_EXIT_OK
 fi
 
+if [ ! -f $DBUS_VAR_DIR/$DBUS_MACHINE_ID_FILE ]; then
+    /opt/csw/bin/dbus-uuidgen --ensure
+fi
+
 case $1 in 
 'start')
         if [ ! -d $DBUS_VAR_RUN_DIR ]; then
                 mkdir -p $DBUS_VAR_RUN_DIR
         fi
+
         if [ -f $DBUS_VAR_RUN_DIR/pid ]; then
+		kill -0 `cat $DBUS_VAR_RUN_DIR/pid`
+		if [ $? -eq 0 ]; then
+			echo "dbus already running"
+			exit 1
+		fi
                 rm -f $DBUS_VAR_RUN_DIR/pid
         fi
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list