Hi Dan,
> The radio playout software depends on a MySQL server running in a
> CentOS VM, which in turn runs on top of WinServer2k8. The audio for
> the playout software also resides on the 2k8 server as a samba share.
>
> The auto playout machine (for when no presenters are in the studio)
> and the studio playout (hot pad for jingles, etc) need to come back up
> automatically, however, at the moment have no way of knowing whether
> MySQL is alive
To test if MySQL's server is listening for client connections, try to
connect(2) to it and ignore any proferred handshake.
nc localhost 3306 </dev/null >/dev/null
The exit status will be 0 if it's listen(2)ing and accept(2)ed. A
closed port will cause nc to return immediately with a non-zero status.
Or you could
$ mysql -NBe 'select 1;'
1
$
Switching to a duff port shows what happens when the server isn't there.
$ mysql --protocol tcp -h localhost -P 3307 -NBe 'select 1;'
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (111)
$ echo $?
1
$
> and can hang on boot because they cant find the samba share. Both
> playout machines run Ubuntu.
Don't they just hang until the Samba share is eventually available? And
that's what's desired? Or doesn't Samba work like that?
> Is there an easy way to achieve this? I was thinking of running a boot
> script on the CentOS VM to wake on lan the hosts, but if anyone has
> any better suggestions it would be greatly appreciated.
I'm not sure why it isn't OK for the dependent machines to hang around
until their dependencies are fulfilled. Are they needed for other work?
Cheers, Ralph.
--
Next meeting: Bournemouth, Tuesday, 2013-08-06 20:00
Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/
New thread on mailing list: mailto:[email protected]
How to Report Bugs Effectively: http://goo.gl/4Xue