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

Michael Watson michael at thewatsonfamily.id.au
Sat Feb 11 01:21:20 UTC 2012

On 11/02/2012 10:04 AM, Andy Sheen wrote:
> 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.
And if the ping succeeds, then the master restarts the mythtv-backend 
process on the slave via ssh connection.
The wake command is executed each time the MBE process is started (or 
restarted), in which case the MBE knows that the slave is thus not 
connected, and attempts to restart the SBE process, if both machines are 
24x7 then you dont need to bother checking if the slave is on, and just 
attempt to restart slave backend process, but I would still atempt to 
check if its actually on first.
     A cron job polling a file share, in my opinion is a bit ugly.

>> Regards,
>> Michael
> Andy
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-users
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.1913 / Virus Database: 2112/4801 - Release Date: 02/10/12

More information about the mythtv-users mailing list