pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

zoneminder: add watchdog script



Module Name:	pkgsrc-wip
Committed By:	Greg Troxel <gdt%lexort.com@localhost>
Pushed By:	gdt
Date:		Sun Dec 1 08:18:44 2024 -0500
Changeset:	eec3e26e31650218881a01e5b67681206033f5a7

Added Files:
	zoneminder/files/start-watchdog.sh

Log Message:
zoneminder: add watchdog script

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=eec3e26e31650218881a01e5b67681206033f5a7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 zoneminder/files/start-watchdog.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diffs:
diff --git a/zoneminder/files/start-watchdog.sh b/zoneminder/files/start-watchdog.sh
new file mode 100755
index 0000000000..f566c95566
--- /dev/null
+++ b/zoneminder/files/start-watchdog.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# On startup, there is a hang (not understood).  This script attempts
+# to identify and kill any such hung processes.  The normal process
+# supervision restarts it, and it seems the second time it doesn't
+# hang.
+
+while sleep 60; do
+    pids=`ps uaxw | egrep 'zmdc.pl start ' | egrep -v egrep | awk '{print $2}'`
+    if [ "$pids" != "" ]; then
+	logger "$0: found $pids"
+	sleep 10
+	for p in $pids; do
+	    if kill -0 $p 2> /dev/null; then
+		logger "$0: pid $p still alive"
+		kill $p
+	    fi
+	done
+    fi
+done


Home | Main Index | Thread Index | Old Index