[mythtv-users] MythTV backend starts before HDHR tuners are available

Gary Buhrmaster gary.buhrmaster at gmail.com
Thu Nov 16 18:29:38 UTC 2023


On Thu, Nov 16, 2023 at 5:44 PM Will Dormann <wdormann at gmail.com> wrote:

> 2) If 1) is true, what is an appropriate way to get an Ubuntu 22.04
> system to start MythTV only after the network is fully up and running?

"Fully up and running" is not a well defined term
when if comes to Linux and Network connectivity.

Some discussion:
   https://systemd.io/NETWORK_ONLINE/

Sometimes adding a Wants= and After=network-online.target
(along with time-sync.target) to the MythTV backend
service file will help (if you have the correct other
services enabled that network-online.target itself
will wait for, such as systemd-networkd-wait-online.service
if you are using systemd-networkd).

The "cheap" way would be something like a
ExecStartPre=-/usr/bin/sleep 10

If you go through the list archives you will
find others who create various scripts that
either try to connect to the HDHR, or ping
some external device.  All can work some of
the time depending on what you mean by
the network being up.

There is also a 3rd party application called
HDHRUtil-Tuner-waitOnline that can be used
to wait for a HDHR to become available and
used either as an ExecStartPre or an instanced
service file with an After (likely one would
create an instanced service file if you wanted
to wait for a number of different HDHRs, but
in reality, if one is available, that would usually
mean all are).  Be aware that if the HDHR does
not actually become available that particular
app will exit with an error, so you need to
accommodate that with a '-' if you use
ExecStartPre


More information about the mythtv-users mailing list