summaryrefslogtreecommitdiffstats
path: root/abs/core/zoneminder/run
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2011-09-20 23:42:12 (GMT)
committerBritney Fransen <brfransen@gmail.com>2011-09-20 23:42:12 (GMT)
commitad5be4387035eec47c68c03169c82a5fa780d0c4 (patch)
tree5dc25cf52d55d8194f2514ac0be6c373fde6e2d8 /abs/core/zoneminder/run
parent05bf1ffe6a564d12266613616133517e9e9e972f (diff)
downloadlinhes_pkgbuild-ad5be4387035eec47c68c03169c82a5fa780d0c4.zip
linhes_pkgbuild-ad5be4387035eec47c68c03169c82a5fa780d0c4.tar.gz
linhes_pkgbuild-ad5be4387035eec47c68c03169c82a5fa780d0c4.tar.bz2
zoneminder: update for runit. refs #770 closes #751
Diffstat (limited to 'abs/core/zoneminder/run')
-rwxr-xr-xabs/core/zoneminder/run19
1 files changed, 17 insertions, 2 deletions
diff --git a/abs/core/zoneminder/run b/abs/core/zoneminder/run
index e458bc8..ce61c24 100755
--- a/abs/core/zoneminder/run
+++ b/abs/core/zoneminder/run
@@ -2,5 +2,20 @@
export TERM=linux
. /etc/rc.conf
. /etc/rc.d/functions
-stat_runit "Starting ZoneMinder"
-exec /etc/rc.d/zm start
+
+while true ; do
+ PID=`pidof -x zmdc.pl`
+ if test -n "$PID" ; then
+ sleep 60
+ continue
+ fi
+ stat_runit "Starting ZoneMinder"
+ /etc/rc.d/zm start
+ if test $? -ne 0 ; then
+ stat_fail
+ else
+ add_daemon zm
+ stat_done
+ fi
+ sleep 30
+done