Disable monit but allow insserv upgrade.
authorValentin Vidic <Valentin.Vidic@CARNet.hr>
Tue, 31 Jan 2012 14:23:22 +0000 (15:23 +0100)
committerValentin Vidic <Valentin.Vidic@CARNet.hr>
Tue, 31 Jan 2012 14:23:22 +0000 (15:23 +0100)
src/actions/main.queue
src/functions.sh

index 285ba62..b1bb65c 100644 (file)
@@ -43,7 +43,7 @@ true                          install_new             # instaliraj nove
 true                           remove_orphaned         # ocisti stare libove nakon sto su cn paketi nadogradjeni
 # i ostatak
 true                           add_group_proc          # za oidentd
-true                           pkgadd monit-cn
+true                           enable_monit
 pkg kernel-2.6-cn              dpkg-reconfigure kernel-2.6-cn
 true                           dpkg-reconfigure sysv-rc
 # ovo bi trebalo biti predzadnje na popisu
index 59cd2af..acc4dad 100644 (file)
@@ -823,9 +823,19 @@ disable_monit () {
     apt-get remove --yes monit
     # stop the binary
     pkill -9 monit || true
+    # move away init for insserv to work
+    mv /etc/init.d/monit /var/lib/carnet-upgrade/
   fi
 }
 
+# allow monit to run again
+enable_monit () {
+  if [ -f /var/lib/carnet-upgrade/monit ]; then
+    mv /var/lib/carnet-upgrade/monit /etc/init.d/monit
+    pkgadd monit-cn
+  fi 
+}
+
 # check which of the given packages are installed
 grep_installed () {
   local package installed