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

bonivart at users.sourceforge.net bonivart at users.sourceforge.net
Fri Apr 24 19:25:44 CEST 2009


Revision: 4468
          http://gar.svn.sourceforge.net/gar/?rev=4468&view=rev
Author:   bonivart
Date:     2009-04-24 17:25:44 +0000 (Fri, 24 Apr 2009)

Log Message:
-----------
cswclassutils: disable persistent state code

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

Modified: csw/mgar/pkg/cswclassutils/trunk/Makefile
===================================================================
--- csw/mgar/pkg/cswclassutils/trunk/Makefile	2009-04-24 11:59:04 UTC (rev 4467)
+++ csw/mgar/pkg/cswclassutils/trunk/Makefile	2009-04-24 17:25:44 UTC (rev 4468)
@@ -1,5 +1,5 @@
 GARNAME = cswclassutils
-GARVERSION = 1.8
+GARVERSION = 1.9
 CATEGORIES = utils
 
 DESCRIPTION = CSW class action utilities

Modified: csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswinitsmf
===================================================================
--- csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswinitsmf	2009-04-24 11:59:04 UTC (rev 4467)
+++ csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswinitsmf	2009-04-24 17:25:44 UTC (rev 4468)
@@ -12,26 +12,28 @@
 # 2009-04-21 Do not create rc links unless enabled (Bug ID 0003633),
 #            Persistent state across upgrades (Bug ID 0003634)
 # 2009-04-22 Fix bug when starting packages with multiple services (Ihsan Dogan)
+# 2009-04-24 Temporarily disabled the "persistent state" code until it can be used
+#            per service, not just per package
 
 DEBUG=		# clear to disable debug, set to anything to enable
 SVCDIR=/var/opt/csw/svc
 
-SMF_STATE_DIR="$PKG_INSTALL_ROOT/etc/opt/csw/preserve/$PKG"
-SMF_STATE_FILE="$SMF_STATE_DIR/smf.state"
+#SMF_STATE_DIR="$PKG_INSTALL_ROOT/etc/opt/csw/preserve/$PKG"
+#SMF_STATE_FILE="$SMF_STATE_DIR/smf.state"
 
 # retrieve the previous state of a service identified by the given FRMI
-load_smf_service_state ()
-{
-    SMF_STATE="disabled"
+#load_smf_service_state ()
+#{
+#    SMF_STATE="disabled"
+#
+#    if [ -f "$SMF_STATE_FILE" ]; then
+#        set -- `/usr/bin/awk " \\\$1 == \"$1\" { print \\\$2 } " "$SMF_STATE_FILE"`
+#        if [ "$1" = "enabled" ]; then
+#            SMF_STATE="enabled"
+#        fi
+#    fi
+#}
 
-    if [ -f "$SMF_STATE_FILE" ]; then
-        set -- `/usr/bin/awk " \\\$1 == \"$1\" { print \\\$2 } " "$SMF_STATE_FILE"`
-        if [ "$1" = "enabled" ]; then
-            SMF_STATE="enabled"
-        fi
-    fi
-}
-
 # Source csw.conf, if it exists
 if [ -f $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf ] ; then
   . $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf
@@ -202,11 +204,11 @@
 
     # Start service
     if [ "$daemon" = "yes" ]; then
-      load_smf_service_state "$FMRI/$service"
-      if [ "$SMF_STATE" = "enabled" ]; then
+#      load_smf_service_state "$FMRI/$service"
+#      if [ "$SMF_STATE" = "enabled" ]; then
         echo Enabling svc:/$FMRI/$service ...
         /usr/sbin/svcadm enable svc:/$FMRI/$service > /dev/null 2>&1
-      fi
+#      fi
     fi
   else
     # Copy the service script
@@ -277,7 +279,7 @@
 done
 
 # we delete the smf state file as we don't need it anymore
-rm -f "$SMF_STATE_FILE"
+#rm -f "$SMF_STATE_FILE"
 
 /usr/sbin/installf -f $PKGINST
 

Modified: csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.r.cswinitsmf
===================================================================
--- csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.r.cswinitsmf	2009-04-24 11:59:04 UTC (rev 4467)
+++ csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.r.cswinitsmf	2009-04-24 17:25:44 UTC (rev 4468)
@@ -13,31 +13,33 @@
 # 2009-04-21 Added -s to svcadm disable, removed sleep (Bug ID 0003632),
 #            Persistent state across upgrades (Bug ID 0003634)
 # 2009-04-23 Fixed bug when stopping non-SMF services
+# 2009-04-24 Temporarily disabled the "persistent state" code until it can be used
+#            per service, not just per package
 
 DEBUG=		# clear to disable debug, set to anything to enable
 
 # The following file is used to save the state of smf service upon
 # package removal
 # This allows to restore the service state across package upgrades.
-SMF_STATE_DIR="$PKG_INSTALL_ROOT/etc/opt/csw/preserve/$PKG"
-SMF_STATE_FILE="$SMF_STATE_DIR/smf.state"
+#SMF_STATE_DIR="$PKG_INSTALL_ROOT/etc/opt/csw/preserve/$PKG"
+#SMF_STATE_FILE="$SMF_STATE_DIR/smf.state"
 
 # The smf state file shouldn't be there at this time but we
 # delete it to be sure
-rm -f "$SMF_STATE_FILE"
+#rm -f "$SMF_STATE_FILE"
 
 # save the current service state for the given frmi
-save_smf_state ()
-{
-    SMF_STATE=`/usr/sbin/svccfg -s "$1:default" listprop general/enabled | /usr/bin/awk '{ print $3 }'`
-    if [ "$SMF_STATE" != "true" ]; then
-        SMF_STATE="disabled"
-    else
-        SMF_STATE="enabled"
-    fi
-    [ -d "$SMF_STATE_DIR" ] || mkdir -p "$SMF_STATE_DIR"
-    echo "$1 $SMF_STATE" >> "$SMF_STATE_FILE"
-}
+#save_smf_state ()
+#{
+#    SMF_STATE=`/usr/sbin/svccfg -s "$1:default" listprop general/enabled | /usr/bin/awk '{ print $3 }'`
+#    if [ "$SMF_STATE" != "true" ]; then
+#        SMF_STATE="disabled"
+#    else
+#        SMF_STATE="enabled"
+#    fi
+#    [ -d "$SMF_STATE_DIR" ] || mkdir -p "$SMF_STATE_DIR"
+#    echo "$1 $SMF_STATE" >> "$SMF_STATE_FILE"
+#}
 
 # Source csw.conf, if it exists
 if [ -f $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf ] ; then
@@ -68,9 +70,9 @@
   FMRI=`grep ${PKGINST}$ /var/sadm/install/contents | grep "^/var/opt/csw/svc/manifest" | egrep '\.xml ' | cut -d'/' -f7- | awk -F'.xml' '{print $1}'`
   for i in `echo $FMRI | tr '\n' ' '`
   do
-    save_smf_state
+#    save_smf_state "$i"
     echo "Disabling svc:/$i ..."
-    /usr/sbin/svcadm -s disable svc:/$i
+    /usr/sbin/svcadm disable -s svc:/$i
     # Unregister with SMF
     echo Unregister svc:/${i}:default with SMF ...
     /usr/sbin/svccfg delete -f svc:/${i}:default


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