Revision: 7442
          http://sourceforge.net/p/ipcop/svn/7442
Author:   owes
Date:     2014-04-08 19:09:31 +0000 (Tue, 08 Apr 2014)
Log Message:
-----------
Add halt fcron mechanism. First used for 2.1.3 update and now default.

Modified Paths:
--------------
    ipcop/trunk/updates/2.1.5/setup

Modified: ipcop/trunk/updates/2.1.5/setup
===================================================================
--- ipcop/trunk/updates/2.1.5/setup     2014-04-08 19:06:46 UTC (rev 7441)
+++ ipcop/trunk/updates/2.1.5/setup     2014-04-08 19:09:31 UTC (rev 7442)
@@ -27,6 +27,22 @@
     exit 1
 fi
 
+# Stop fcron, to keep tasks from running during update
+FCRONPID=`cat /var/run/fcron.pid`
+/bin/kill $FCRONPID
+COUNT=30
+
+while [ -e /var/run/fcron.pid -a ${COUNT} -ge 0 ]
+do
+    sleep 1
+    COUNT=$(( ${COUNT} - 1 ))
+done
+
+if [ -e /var/run/fcron.pid ]; then
+    msg "kill fron, still running after 30 seconds"
+    /bin/kill -KILL $FCRONPID
+fi
+
 #####
 #
 # Add version specific handling *before* unpacking the patch here.
@@ -82,13 +98,19 @@
 #####
 
 
-
 #####
 #
 # End of version specific handling. Continue with universal stuff.
 #
 #####
 
+# Restart fcron
+if [ -e /etc/FLASH ]; then
+    /usr/sbin/fcron -s 86400
+else
+    /usr/sbin/fcron
+fi
+
 # Patch general-functions.pl
 /bin/sed -i -e "s+^\(\$General::version\s*=\s*\).*+\1'$UPGRADEVERSION';+" 
/usr/lib/ipcop/general-functions.pl
 # Patch /etc/issue

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


------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to