cvs commit: ports/multimedia/zoneminder/files zm.in
Matthew Seaman
m.seaman at infracaninophile.co.uk
Wed Jul 6 21:11:58 UTC 2011
On 06/07/2011 21:33, Doug Barton wrote:
> Of course, if there was some mysql command you could run to verify that
> the db is up that would be better than an unconditional sleep. Something
> like this:
>
> zm_prestart()
> {
> local _count=0
>
> while : ; do
> <mysqltestcommand> && return
>
> _count=$(( $_count + 1 ))
> if [ $_count -gt 10 ]; then
> err 1 "${name}: <mysqltestcommand> failed"
> fi
>
> sleep 1
> done
> }
>
Testing for the existence of the MySQL unix domain socket is a pretty
good indicator of whether MySQL is up and doing yet, and pretty cheap in
scripting terms:
while : ; do
[ -S /tmp/mysql.sock ] && return
...etc
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matthew at infracaninophile.co.uk Kent, CT11 9PW
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/cvs-ports/attachments/20110706/dd44d110/signature.pgp
More information about the cvs-ports
mailing list