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
This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig12A5D12269C76D0C6E689023 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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. Somethin= g > like this: >=20 > zm_prestart() > { > local _count=3D0 >=20 > while : ; do > <mysqltestcommand> && return >=20 > _count=3D$(( $_count + 1 )) > if [ $_count -gt 10 ]; then > err 1 "${name}: <mysqltestcommand> failed" > fi >=20 > sleep 1 > done > } >=20 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 --=20 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 --------------enig12A5D12269C76D0C6E689023 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----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----- --------------enig12A5D12269C76D0C6E689023--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E14CF91.1010302>