[mythtv-users] Autostart frontend ONLY on manual startup?
George Nassas
gnassas at mac.com
Wed Apr 6 16:37:58 UTC 2005
On 6-Apr-05, at 8:03 AM, Ashley Bostock wrote:
> On Mar 3, 2005 10:39 PM, Lane Schwartz <dowobeha at gmail.com> wrote:
>> Has anyone figured out an elegant way to do the following:
>> - Have Myth frontend start up automatically if and only if the machine
>> was started manually
> Any one know if the funcationality was completely removed? or was is
> reimplemented in different way? I have a feeling that instead of
> having to bodge together some script to guess, that you can just query
> mythbackend on whether it was started automatically or not.
I'm less familiar with the pre 0.16 releases but in 0.17 the frontend
checks if you're using an idle timeout on the backend (ie, anything >
0) and if you are it connects to the backend right away to prevent it
shutting down. If the idle time is off (== 0) then it waits to connect
until it needs to
To accomplish what Lane wants I started with a script that checks the
current nvram/rtc wakeup time and if it's within the last 10 minutes I
assume an automatic wakeup, anything else I figure it's a manual
startup. This is signalled through the script's exit status. The other
piece is a script that alternately shows mythfrontend and a hacky
log-fed "myth is doing XXX press OK for myth" screen. When you come out
of one you go right into the other. The autostart status decides which
part of the loop comes up first.
I find this works well with the non-technical types I've built myth
boxes for like my sisters and friends. They know if they see the myth
menus then the machine will stay up until they're done and if they're
seeing the status screen then the box will decide on its own when it's
time to shut down. Oh, I'm using a 60 second idle timeout to make the
connection/shutdown logic work the way I need.
The other observation I have is I found it more reliable to use the rtc
for autostart status. When I was going to the backend I'd run into race
conditions where the frontend was up before the backend and sometimes I
would get the status wrong in hard to understand ways.
- George
P.S. Apologies if this shows up twice, my first send was from the
address not subscribed to the list.
More information about the mythtv-users
mailing list