[mythtv-users] Way to tell BE came up after power fail?

Craig Huff huffcslists at gmail.com
Sat Nov 2 18:13:53 UTC 2013


On Wednesday, October 30, 2013, R. G. Newbury wrote:
>
> 1)
> A two-stage scripted system,
> Main part runs under cron every minute/5 minutes whatever. The cron runs a
> script which calls 'uptime > /home/mythtv/uptimer'.
>
> The other part is a line in /etc/rc.d/rc.local (or some other initscript)
> which renames /home/mythtv/uptimer to uptimer-old on boot.
> If you have a 'old' the system has rebooted, and you can tell how long ago
> from the new uptimer.
>
>
> 2)
> Or something like this, using cron OR an init-script:
> The cron first writes uptime to /home/mythtv/uptimer
> The cron then attempts to copy /home/mythtv/uptimer to /tmp/uptimer/uptimer
>
> After a reboot /tmp/uptimer will not exist and an error will be raised.
> The error condition requires operator action to clear.
>
> Post-notification handling is left to the student as an exercise!
>
>
> Geoff
>


Geoff-

Thanks for the idea. Unfortunately, in my case (OP), the problem arises
when the system is down on purpose -- nothing to do -- and power is
removed.  In this case, my system is configured to wake up when power is
restored.  This had two issues: how to tell the system came up due to a
power interruption as opposed to a user wanting to do something
off-schedule (e.g. Watch something), and get the IR Transmitter/Receiver
configuration fixed (it consistently fails the first time up after power
interruption).  My solution to both problems is not robust in that it
depends on continued misbehavior that most likely will get fixed in some
newer version of the O/S or LIRC SW.

What would be ideal would be a way to find out programmatically from the
BIOS that the system was brought up on power restore, not the "On" switch,
WOL, etc.

In any case thanks for taking the time to make the suggestion.  It may give
someone else an idea how to solve a variant of the situation.

--
Craig.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20131102/7844e776/attachment.html>


More information about the mythtv-users mailing list