[mythtv-users] Rebooting master results in slave not connected

Andy Sheen sheen.andy at googlemail.com
Fri Feb 10 23:04:42 UTC 2012


Hi Michael,

Michael Watson wrote on Fri 10 Feb at 22:03 UK time
> On 11/02/2012 7:05 AM, Andy Sheen wrote:

> Or one simple script;
> Set your "Slave Backend Wake Command" to a script, lets call it mywake.sh.
> Mywake.sh pings the slave backend, if ping is successful, restart 
> mythbackend via ssh, if unsuccessful use WOL to wake the slave backend.
> You would need to configure ssh login without password, and sudo 
> privileges on slave to restart mythtv-backend process.
> 

Both the master and slave are up 24/7 as they are used for other things.
They can independently be rebooted though and it is this race condition
I want to remove.

What I have implemented is whenever the master mythtv-backend is
restarted, the computer that is the master writes a file to a shared
location. The slaves regularly (via cron) look at the creation date of
the file and decide if they have been up longer than the master back
end. If they have, and MythTV isn't busy recording, the slave backend is
restarted.

The advantage of this is that the slaves are independently responsible
for deciding if they should restart their own backend process.

The problem with the master deciding whether the backend should be
restarted is that it needs to understand the state of the slave. In your
example in my system (which doesn't implement any form of wake) the
slave backend will be up all the time so the ping will always succeed.

> Regards,
> Michael
> 

Andy


More information about the mythtv-users mailing list