[mythtv-users] local-network-pingable.service

Hika van den Hoven hikavdh at gmail.com
Mon Dec 6 14:23:43 UTC 2021

Hoi James,

Monday, December 6, 2021, 2:51:14 PM, you wrote:

> On Mon, Dec 6, 2021 at 7:34 AM Werner Mahr
> <werner at vollstreckernet.de> wrote:

> Am Montag, 6. Dezember 2021, 12:29:03 CET schrieb Jim Abernathy:
 >> I'm trying to clean up any race conditions that may exist in my
 >> production backend since I have both HDHomeRun network tuners and PCIe
 >> cards.
>  Isn't just a dep of mythtv-backend on systemd-networkd-wait-online doing what
>  you want?
>  -- 
>  MfG usw.
>  Werner Mahr

> My system was built with Xubuntu 20.04 so it has NetworkManager
> instead of systemd-networkd. Because my main tuner is a Hauppauge
> WinTV quadTV PCIe card mythtv-backend has always started with access
> to tuners. I think that is because of my
> mythtv-backend.service.d/mythtv-backend-override.conf file:
> [Unit]
> Wants=dev-dvb-adapter0-frontend0.device
> After=dev-dvb-adapter0-frontend0.device
> Wants=dev-dvb-adapter1-frontend0.device
> After=dev-dvb-adapter1-frontend0.device
> Wants=dev-dvb-adapter2-frontend0.device
> After=dev-dvb-adapter2-frontend0.device
> Wants=dev-dvb-adapter3-frontend0.device
> After=dev-dvb-adapter3-frontend0.device

> After=NetworkManager-wait-online.service

> [Service]
> ExecStop=/usr/local/bin/mythbackendstop.sh

> SendSIGKILL=yes
> TimeoutStopSec=10

> However, when I add a HDHR quatro network tuner into the mix, there
> is sometimes a race condition where the network is up
> (NetworkManager-wait-online.service is satisfied), but the network
> tuner doesn't respond at that point. Stephen's solution is waiting
> until the tuner is pingable. So I also have a config file,
> mythtv-backend.service.d/mythtv-backend-wait-until-pingable.conf:
> [Unit]
> Wants=local-network-pingable.service
> After=local-network-pingable.service

>  That service was listed in the original email.

> The solution is solid, I just didn't understand the ExecStartPre= part.

> Jim A

I'm still running open-rc, systemd sniffs to me to much of Windows and
is much more difficult to configure with acceptable results.

I run a simpel testloop in de mythbackend startup script:

        ebegin "Testing if HD homerun responds"
        IsAwake=`ping -q -c1 ${hdhr_ip} | grep received | cut -f4 -d ' '`
        while [ "$IsAwake" == "0" ]; do
                ebegin "Waiting for the HD homerun to responds"
                sleep 1
                IsAwake=`ping -q -c1 ${hdhr_ip} | grep received | cut -f4 -d ' '`

As the hdhomerun is connected to a dedicated nic on the backend not
only must that specific nic/network be up but also dhcpd must be and
the hdhomerun must have received an ip-address. So I guess difficult
to configure in systemd. Also when I ones tried out systemd, I could
not start my nics as early in the boot process as I need to.
(I use NIS-like network management on ldap and I need that accessible
as early as possible.)

Tot mails,
  Hika                            mailto:hikavdh at gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens

More information about the mythtv-users mailing list