diff options
author | bsam <bsam@FreeBSD.org> | 2011-07-10 02:55:02 +0800 |
---|---|---|
committer | bsam <bsam@FreeBSD.org> | 2011-07-10 02:55:02 +0800 |
commit | edd2706f9cde22575366fef176dd91763346983a (patch) | |
tree | 3ec7b42d92eab54cf156fa4c27be45694572b1f2 /multimedia | |
parent | 0ca8b255e719c87be62c5c543224676638f5db56 (diff) | |
download | freebsd-ports-gnome-edd2706f9cde22575366fef176dd91763346983a.tar.gz freebsd-ports-gnome-edd2706f9cde22575366fef176dd91763346983a.tar.zst freebsd-ports-gnome-edd2706f9cde22575366fef176dd91763346983a.zip |
. update RC script: create procedure zm_prestart() to detect when
mysqld may be used by zoneminder;
. delete 10 seconds sleep;
. bump PORTREVISION.
Submitted by: dougb (thanks!)
Diffstat (limited to 'multimedia')
-rw-r--r-- | multimedia/zoneminder/Makefile | 2 | ||||
-rw-r--r-- | multimedia/zoneminder/files/zoneminder.in | 16 |
2 files changed, 16 insertions, 2 deletions
diff --git a/multimedia/zoneminder/Makefile b/multimedia/zoneminder/Makefile index 8fd721088663..1051ceab6215 100644 --- a/multimedia/zoneminder/Makefile +++ b/multimedia/zoneminder/Makefile @@ -7,7 +7,7 @@ PORTNAME= zoneminder PORTVERSION= 1.24.4 -PORTREVISION= 11 +PORTREVISION= 12 CATEGORIES= multimedia MASTER_SITES= http://www2.zoneminder.com/downloads/ \ http://www.zoneminder.com/downloads/ diff --git a/multimedia/zoneminder/files/zoneminder.in b/multimedia/zoneminder/files/zoneminder.in index 5d17c317077b..f0d4f5008446 100644 --- a/multimedia/zoneminder/files/zoneminder.in +++ b/multimedia/zoneminder/files/zoneminder.in @@ -24,6 +24,7 @@ command=%%PREFIX%%/bin/zmpkg.pl command_args="$1" pidfile=/var/run/zm/zm.pid +start_precmd=zm_prestart stop_cmd="zm_stop" status_cmd="zm_status" @@ -35,6 +36,19 @@ zm_status() { %%PREFIX%%/bin/zmdc.pl status } -[ "${command_args}" = "faststart" ] && echo -n "zoneminder: 10 seconds pause..." && sleep 10 && echo " done" +zm_prestart() { +local _count=0 + + while : ; do + echo "USE zm; SELECT Username from Users where Id=1;" | \ + %%LOCALBASE%%/bin/mysqltest -u root zm > /dev/null 2>&1 && return + _count=$(( $_count + 1 )) + if [ $_count -gt 10 ]; then + err 1 "${name}: mysqltest command failed" + fi + + sleep 1 + done +} run_rc_command "$1" |