[mythtv-users] Master backend and slave be/fe shutdown problem

Ma Begaj derliebegott at gmail.com
Mon Oct 26 10:56:41 UTC 2009


009/10/26 Chris Pinkham <cpinkham at bc2va.org>:
> * On Sun Oct 25, 2009 at 02:03:42PM +0100, Ma Begaj wrote:
>> There is a problem which appear in this configuration:
>> >> When I start slave box master backend is running SleepCommand on every start.
>
> Yes, if the slave backend has this setting configured, then the master
> backend will command the slave backend to run this command when there
> are no recordings scheduled on the slave in the next 45 minutes.
>
>> SleepCommand on my slave is a real shutdown command. So every time I
>> boot my slave box manually to watch recordings master backend wants to
>> shut it down. It runs this command even before mythfrontend on this
>> slave started.
>
> The functionality to shutdown and wakeup slaves isn't fully able to do
> this for slaves that are also running frontends.
>
> If you want to use the slave shutdown wakeup functionality on a combined
> slave backend/frontend, then you'll have to do several things and there
> will be limitations.
>

It would be pretty easy if master backend would send GO_TO_SLEEP every
few minutes while slave is online. But it just sends it once (usually
already on boot) and that's it. If it would send it every few minutes
my current SleepCommand script could finish the job pretty easy:

#!/bin/sh
sleep 60
ps -C mythfrontend >/dev/null && exit
ps -C mplayer >/dev/null && exit
/usr/bin/mythshutdown -s && /sbin/shutdown -h now

Is there a reason for not sending this GO_TO_SLEEP command again and
again every few minutes until slave is shutdown? Closing mythfrontend
would be enough to let master backend to shut down slave.

I will try to write a shell script today which somehow could solve
this temporary for me.

> Your slave's sleep command has to know whether to shutdown the system
> or just shutdown mythbackend.  The backend needs to shutdown when it
> is told to so that the master backend puts it in the correct state.
> If you shutdown mythbackend and keep the system up in order to continue
> using mythfrontend, then when you shutdown mythfrontend, you need to
> shut it down in a mode such that it can be awakened by the master when
> needed.  If the master needs to wakup the slave backend after you
> have shut the save mythbackend process down, but have not shutdown the
> frontend or physical machine, then the master will not be able to
> restart the slave mythbackend process.  Supporting this is an
> enhancement and I've added a note to my TODO list to add this
> functionality.  It's not a large amount of work, but when I added this
> functionality, I didn't intend it to be used on combined
> backends/frontends.  The solution to fully supporting this on
> combined frontends/backends is two-fold.  1) The slave needs to be able
> to tell the master than it can not shutdown right now because the
> frontend is running/busy.  2) There needs to be a way to shutdown the
> slave manually and tell the master that the slave is going to sleep so
> that the master knows it can wake the slave up if it needs it later.
>

I like the idea of using SleepCommand to shutdown whole slave system.
There is no point to shut down slave mythbackend process if the
frontend on the slave system is still being used.

A checkbox "wait for mythfrontend" in slave settings in MythTv-Setup
could solve this.



Thanks for developing this. I would suggest to make mythtv-setup more
simple. It is confusing to be able to change some of the master
backend settings when running mythtv-setup on the slave backend
system.

Thanks.

M.


More information about the mythtv-users mailing list