RPM scripts should allow newbinary restart to restart
authorDerrick Brashear <shadow@dementia.org>
Wed, 27 Oct 2010 00:13:38 +0000 (20:13 -0400)
committerDerrick Brashear <shadow@dementia.org>
Fri, 29 Oct 2010 18:33:00 +0000 (11:33 -0700)
add a mode where a newbinary restart can be used instead of
condrestart to induce a restart.

also, on upgrade, don't turn on the server RC script if it was
previously manually disabled.

Change-Id: I0e45be751cb2c5d9392d85467a979a22f5a777cf
Reviewed-on: http://gerrit.openafs.org/3163
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/packaging/RedHat/openafs-server.init
src/packaging/RedHat/openafs.spec.in

index 5cd510d..ad340a6 100644 (file)
@@ -72,7 +72,16 @@ case "$1" in
         rhstatus
         ;;
   condrestart)
-        [ -f /var/lock/subsys/openafs-server ] && restart || :
+       if [ "x$AFS_USE_BINARY_RESTART" = "xyes" ]; then
+           # this is what never shows up as
+           if [ `grep -c 'checkbintime 16 0 0 0 0' /usr/afs/local/BosConfig` = 1]; then
+               [ -f /var/lock/subsys/openafs-server ] && restart || :
+           else
+               echo $"deferring for newbinary restart"
+           fi
+       else
+           [ -f /var/lock/subsys/openafs-server ] && restart || :
+       fi
         ;;
   *)
         echo $"Usage: $0 {start|stop|status|restart|condrestart}"
index 1fdc319..0a8302c 100644 (file)
@@ -1325,7 +1325,10 @@ echo before the one for pwdb.
 echo
 
 %post server
-chkconfig --add openafs-server
+#on an upgrade, don't enable if we were disabled
+if [ $1 = 1 ] ; then
+  chkconfig --add openafs-server
+fi
 %{initdir}/openafs-server condrestart
 
 %if %{build_authlibs}