Try harder to disable monit.
[carnet-upgrade.git] / src / functions.sh
index 62dbbe7..b595580 100644 (file)
@@ -591,6 +591,22 @@ remove_skey () {
   fi
 }
 
+# monit it causing problems for postinst scripts
+# restarting daemons so try to disable it
+disable_monit () {
+  if pkg monit-cn; then
+    pkgrm monit-cn # disables monit in prerm
+  fi
+
+  # if configured manually
+  if pkg monit; then
+    # remove the binary but leave the config
+    apt-get remove --yes monit
+    # stop the binary
+    pkill -9 monit || true
+  fi
+}
+
 # make a silent upgrade to new libc6
 upgrade_libc () {
   DEBIAN_FRONTEND=noninteractive pkgadd libc6