[csw-devel] SF.net SVN: gar:[13862] csw/mgar/pkg/cswclassutils/trunk

bonivart at users.sourceforge.net bonivart at users.sourceforge.net
Sat Mar 19 17:16:27 CET 2011


Revision: 13862
          http://gar.svn.sourceforge.net/gar/?rev=13862&view=rev
Author:   bonivart
Date:     2011-03-19 16:16:26 +0000 (Sat, 19 Mar 2011)

Log Message:
-----------
cswclassutils/trunk: testing a patch for initsmf

Modified Paths:
--------------
    csw/mgar/pkg/cswclassutils/trunk/Makefile
    csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswinitsmf

Modified: csw/mgar/pkg/cswclassutils/trunk/Makefile
===================================================================
--- csw/mgar/pkg/cswclassutils/trunk/Makefile	2011-03-19 15:57:41 UTC (rev 13861)
+++ csw/mgar/pkg/cswclassutils/trunk/Makefile	2011-03-19 16:16:26 UTC (rev 13862)
@@ -1,10 +1,10 @@
 # $HeadURL$
 
 NAME = cswclassutils
-VERSION = 1.42
+VERSION = 1.43
 CATEGORIES = utils
 
-# a few handy functions for defining 'generic' things dynmaically
+# a few handy functions for defining 'generic' things dynamically
 set = $(eval $1 := $2)
 
 define cas_shortname

Modified: csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswinitsmf
===================================================================
--- csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswinitsmf	2011-03-19 15:57:41 UTC (rev 13861)
+++ csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswinitsmf	2011-03-19 16:16:26 UTC (rev 13862)
@@ -235,14 +235,16 @@
     if [ "`grep '^#AUTOENABLE' $dest`" ]; then
       AUTOENABLE=`grep '^#AUTOENABLE' $dest | awk '{print $2}' | /usr/xpg4/bin/tr -s '[:upper:]' '[:lower:]'`
     fi
-    if [ "$daemon" = "yes" -a "$AUTOENABLE" != "no" -a "$AUTOENABLE" != "false" ]; then
-      load_smf_service_state "$FMRI/$service"
-      if [ "$SMF_STATE" = "enabled" ]; then
-        echo "Clearing svc:/$FMRI/$service in case it's in the maintenance state..."
-        /usr/sbin/svcadm clear svc:/$FMRI/$service > /dev/null 2>&1
-        echo Enabling svc:/$FMRI/$service ...
-        /usr/sbin/svcadm enable svc:/$FMRI/$service > /dev/null 2>&1
-      fi
+
+    load_smf_service_state "$FMRI/$service"
+    # enable the service if it was enabled before, OR if $daemon = yes and AUTOENABLE is set
+    # previous SMF state always takes precedence
+    # note: autoenable_daemons and autoenable_$service controls $daemon, $AUTOENABLE is set by the package itself
+    if [ "$SMF_STATE" = "enabled" ] || [ "$daemon" = "yes" -a "$AUTOENABLE" != "no" -a "$AUTOENABLE" != "false" ]; then
+      echo "Clearing svc:/$FMRI/$service in case it's in the maintenance state..."
+      /usr/sbin/svcadm clear svc:/$FMRI/$service > /dev/null 2>&1
+      echo Enabling svc:/$FMRI/$service ...
+      /usr/sbin/svcadm enable svc:/$FMRI/$service > /dev/null 2>&1
     fi
   else
     # Copy the service script


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