Mythbackend starts before network is working.

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

Moderator: Forum Moderators

Post Reply
AKADAP
Junior
Posts: 41
Joined: Sat Apr 05, 2014 11:50 pm
United States of America

Mythbackend starts before network is working.

Post by AKADAP » Mon Jul 18, 2016 10:22 pm

This causes problems because if the network is not running when mythbackend starts, it assumes there is no network, and can't see the HDHomeRun tuners.
What is the proper way to guarantee that mythbackend does not start until after the network is functional?


AKADAP
Junior
Posts: 41
Joined: Sat Apr 05, 2014 11:50 pm
United States of America

Re: Mythbackend starts before network is working.

Post by AKADAP » Tue Jul 19, 2016 3:55 am

Thanks.

I was given a simpler solution on the mailing list, and I came back to add it here.
Edited to add that I'm running Mint 18
1)copy /lib/systemd/system/mythtv-backend.service to /etc/systemd/system/mythtv-backend.service.
Make a copy so that an update wont delete the changes you make to the file in systemd

2)edit /etc/systemd/system/mythtv-backend.service, add the following line to the [Service] section:

ExecStartPre=/usr/bin/nm-online --quiet --timeout=5

(On my system I changed the timeout to 20 seconds. I guess I'm just paranoid).

3)Reboot

There were other solutions that test if a HDHomeRun tuner is on-line instead of the nm-online command. These might be useful if your computer can boot faster than an HDHomeRun after a power outage. My tuners and computer are on a UPS, and I believe that my computer boots slow enough that the HDHomeRuns will come up first.
It would be really good if the MythTV project would come up with a robust boot sequence.

User avatar
dizygotheca
Developer
Posts: 267
Joined: Wed Sep 03, 2014 9:02 am
Great Britain

Re: Mythbackend starts before network is working.

Post by dizygotheca » Tue Jul 19, 2016 8:45 pm

It would be really good if the MythTV project would come up with a robust boot sequence.
This project only provides the code & build system.
It's used on different Linux distros, Mac, Windows, Arm and others, all of which have different environments/boot sequences.
It's the responsibility of the packagers to tailor the installation for each.

The Mythbuntu team http://www.mythbuntu.org/repos package Myth for Ubuntu (& therefore Mint)
They are under-resourced, over-worked and under-appreciated but always welcome help resolving problems.
Google reports Myth on Mint to be particularly difficult but it's not apparent why.

Many issues relate to Ubuntu recently moving to systemd.
But why did your database not install correctly ?
And why do the standard start-up scripts not wait for your networking ?

Now that you've got a working system, can you shed any light on them ? (compare a clean install on a VM ?) It would benefit you the next time you bite the bullet.

As for the Homeruns, I'm surprised there's nothing already on the wiki. You could add them there or propose it on the users list.

AKADAP
Junior
Posts: 41
Joined: Sat Apr 05, 2014 11:50 pm
United States of America

Re: Mythbackend starts before network is working.

Post by AKADAP » Wed Jul 20, 2016 4:32 am

I did a clean install of Mint 18, and installed MythTV from the software manager.
I made the mistake of trying to run mythfrontend which got me in an infinite restart loop with the frontend restarting every time I tried to exit it.
I believe that this was caused by the database not being set up correctly. If you look at my other thread, this was also a problem in mint 17 and mint 16.
I manually set up the database, and imported a previous backup.
I believe the next major problem I was having was that mythbackend was starting before the network. I tried many things to fix this before I figured this out, but I don't know of any of them besides fixing the race condition were actually necessary.
I think the reason my backend start and backend stop in backend setup were wrong was because I restored the database form a system that was not running systemd. The fact that backend setup pretended to shut down the backend and did not warn me that it had failed delayed my getting the issues fixed quite a bit.

Post Reply