Date: Wed, 06 Jul 2011 22:11:45 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: cvs-ports@freebsd.org Subject: Re: cvs commit: ports/multimedia/zoneminder/files zm.in Message-ID: <4E14CF91.1010302@infracaninophile.co.uk> In-Reply-To: <4E14C69C.8030200@FreeBSD.org> References: <201107061434.p66EY0OG062221@repoman.freebsd.org> <4E14B6E4.50609@FreeBSD.org> <00116999@h30.sp.ipt.ru> <4E14C69C.8030200@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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@infracaninophile.co.uk Kent, CT11 9PW
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk4Uz5kACgkQ8Mjk52CukIzBwwCeOmulP4ZOYMrTINocm4FTtJYn
e3AAn3m7hi1PrtapwvnVMahWGES1Dn4Q
=foLa
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E14CF91.1010302>
