Mythtv fails to start because network isn't up.

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
raydude
Junior
Posts: 16
Joined: Sat Sep 02, 2017 8:08 pm
United States of America

Mythtv fails to start because network isn't up.

Post by raydude » Sun Apr 26, 2020 4:13 pm

I'm using an HDHOMERUN as my recording device.

When mythbackend starts as a service, it appears to run too early and fails to connect to the external HDHOMERUN device.

This causes recordings to fail after rebooting, unless I remember to restart mythbackend, then it's fine.

It used to be that I could change the rc script to "need" net, but that doesn't fix the problem anymore.

Is it unreasonable for the backend to be changed to timeout on network devices and try again?

Or is there some other way to ensure that mythbacked doesn't start too soon?

The issue here is timing.

Thanks much for any suggestions.

MikeB2013
Senior
Posts: 519
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Mythtv fails to start because network isn't up.

Post by MikeB2013 » Sun Apr 26, 2020 4:46 pm

As a guess as you have not mentioned either mythtv version or operating system.

If running *ubuntu 18.04 see https://lists.gt.net/mythtv/users/625986#625986

This solution is mentioned in Software Install section of https://www.mythtv.org/wiki/Installing_MythTV_on_Ubuntu

Mike

User avatar
paulh
Developer
Posts: 544
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: Mythtv fails to start because network isn't up.

Post by paulh » Sun Apr 26, 2020 5:20 pm

Yes of cause in an ideal world MythTV would be able to keep trying to connect to the HDHOMERUN if it can't connect at start up but that currently isn't possible.

Your best work around is to fix your setup to delay starting mythbackend until the network is fully up using the tools provided by whatever init system you are using. As Mike said we don't know what your setup is and there are many ways to accomplish this.

There has been many discussions about this on this forum and the mailing lists including this recent one for Ubuntu users (as you can see it's not possible to say do it this way and it will work we can give you hints but you may have to tweak things to work reliably for your particular setup) :-
https://github.com/MythTV/packaging/pull/77

This is the mythtv-backend.service file I use on my own Ubuntu 18.04.4 LTS servers that I run virtualised under VMware ESX that seems to work fine for me and I use several different network tuners including a HDHomeRun Connect Quatro but YMMV :).
https://github.com/paul-h/packaging/blo ... nd.service

raydude
Junior
Posts: 16
Joined: Sat Sep 02, 2017 8:08 pm
United States of America

Re: Mythtv fails to start because network isn't up.

Post by raydude » Sun Apr 26, 2020 8:49 pm

Thanks.

I'm running Gentoo.

needs net mysql isn't working, there must be something else it needs.

I'll keep digging.

raydude
Junior
Posts: 16
Joined: Sat Sep 02, 2017 8:08 pm
United States of America

Re: Mythtv fails to start because network isn't up.

Post by raydude » Sun Apr 26, 2020 10:06 pm

Note: If the HDHOMERUN crashes (and it does periodically) then mythtv loses connection and won't recover without a backend restart. I lose recordings because of this periodically. That is yet another reason to have a timeout in the code.

For those who find this in the future (who use Gentoo):

To ensure that networking is up and running before mythbackend starts:

You must have a fixed IP assigned in /etc/conf.d/net for the device mythtv is using to talk to the hdhomerun.

You must ensure that net.[device] is setup for the boot run level (rc-update add net.[device] boot).

You must change the mythbackend init.d script to say "need net" (default is "use net") to ensure that mythbackend starts after networking is up.

For some reason, if you use dhcp, it won't work. I gave up trying to figure out why.

Post Reply