[csw-maintainers] /testing Please help test updated CAS initsmf

Peter Bonivart bonivart at opencsw.org
Sun Mar 27 16:14:44 CEST 2011


On Sun, Mar 27, 2011 at 4:11 PM, Ben Walton <bwalton at opencsw.org> wrote:
> Excerpts from Peter Bonivart's message of Sun Mar 27 09:40:48 -0400 2011:
>
> Hi Peter,
>
>> # pkgutil -t http://buildfarm.opencsw.org/opencsw/experimental/bonivart
>> -u cas_initsmf
>
> I've updated this on a few boxes and will let you know if I see
> anything that doesn't seem right.  Assume that no news is good news
> from me.

Thanks. This is the actual patch if someone wants to just look at it:

Index: CSWcswclassutils.i.cswinitsmf
===================================================================
--- CSWcswclassutils.i.cswinitsmf	(revision 13715)
+++ CSWcswclassutils.i.cswinitsmf	(working copy)
@@ -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


More information about the maintainers mailing list