1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

. 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!)
This commit is contained in:
Boris Samorodov 2011-07-09 18:55:02 +00:00
parent c5d9dc770a
commit 1a59abafcf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=277411
2 changed files with 16 additions and 2 deletions

View File

@ -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/

View File

@ -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"