[mythtv-users] delaying mythbackend startup until a STB is available

Stephen Worthington stephen_agent at jsw.gen.nz
Tue Feb 5 10:58:28 UTC 2019

On Tue, 5 Feb 2019 15:47:20 +0530, you wrote:

>On Tue, 5 Feb 2019 15:08 Stephen Worthington <stephen_agent at jsw.gen.nz
>> I do not know of any way for Linux to know that it has had a power
>> failure or similar bad shutdown.
>You could script it, maybe touch a file on successful shutdown in non
>volatile storage, perhaps by modifying the backend unit file. On startup,
>if file exists, shutdown was clean, delete the file and carry on. If the
>file does not exist, sleep for x time and then carry on.
>Cheers, Ian

Except that you can not touch files after the filesystem has been shut
down.  And if you touch a file before the shutdown, you can still get
a bad shutdown that happens after that point.  In this particular
case, you can also get the case where the power goes off while the
MythTV box is down for maintenance (eg kernel upgrade).  But setting a
flag like that does reduce the window of time when things can happen
without the system knowing about it.

More information about the mythtv-users mailing list