aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/netmond/files/netmond_watchdog.in
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/netmond/files/netmond_watchdog.in')
-rw-r--r--net-mgmt/netmond/files/netmond_watchdog.in18
1 files changed, 18 insertions, 0 deletions
diff --git a/net-mgmt/netmond/files/netmond_watchdog.in b/net-mgmt/netmond/files/netmond_watchdog.in
new file mode 100644
index 000000000000..b3a7bb8c8e24
--- /dev/null
+++ b/net-mgmt/netmond/files/netmond_watchdog.in
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+PATH=/bin:/usr/bin
+export PATH
+pidfile=/var/run/netmond.pid
+config=%%PREFIX%%/etc/netmond.conf
+
+while : ; do
+ if [ -r $pidfile ] && kill -0 `cat $pidfile` >/dev/null 2>&1 ; then
+ # echo "Netmond Running"
+ else
+ # echo "Netmond failed"
+ logger -p daemon.err -t netmond_watchdog "Netmond failed. Restarting..."
+ rm -f ${pidfile}
+ %%PREFIX%%/sbin/netmond -c ${config}
+ fi
+ sleep 10
+done