[Solved] v32 - running mythtv-setup with no changes required after system reboot

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

Moderator: Forum Moderators

Post Reply
Revilo
Junior
Posts: 15
Joined: Sat May 21, 2022 2:38 am
United States of America

[Solved] v32 - running mythtv-setup with no changes required after system reboot

Post by Revilo »

Hello, I recently upgraded to v32 from v29. I'm running it under linux Mint 19.

With v29 I could reboot the system and mythtv would work fine with no further action.

With v32 when I reboot the system, the PVR stops working until I run mythtv-setup. I don't need to make any changes. I just start, enter password, exit and enter password again. Running the setup in v29 didn't require entering my password, so it seems like entering the password is the key. It's not a big problem until I do a reboot and then forget to run setup. I'd like to eliminate the need for running setup after every boot. Besides reverting to v29 or writing a shell script to run mythtv-setup on system startup, is there another option for fixing this?
User avatar
bill6502
Developer
Posts: 2308
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: v32 - running mythtv-setup with no changes required after system reboot

Post by bill6502 »

This answer assumes your backend runs on a host with systemd.

I suspect that the tuners aren't initialized when the backend starts. mythtv-setup typically
stops the backend and restarts it when it's exited.

Next time this happens, try just stopping the backend and restarting it (don't run
mythtv-setup.) If that also works, then apply the solutions here:
https://www.mythtv.org/wiki/Systemd_myt ... nitialized
Revilo
Junior
Posts: 15
Joined: Sat May 21, 2022 2:38 am
United States of America

Re: v32 - running mythtv-setup with no changes required after system reboot

Post by Revilo »

Thanks for your help. It seems like you have me on the right track, just haven't got to a solution yet.

I forced a system reboot and then verified live TV and PVR not working. Then I stopped and restarted mythbackend, live TV and PVR then worked. BTW, I should have mentioned that I have an HD Homerun network tuner. I added the following two lines at the end of the [Unit] section in /lib/systemd/system/mythtv-backend.service :

Code: Select all

Wants=pingnetwork.service
After=pingnetwork.service
I also created the /etc/udev/rules.d/99-mythbackend.rules file with the SUBSYSTEM== lines per the link you provided (is this necessary for for a network tuner?) I then rebooted. Live TV/PVR were not working just as before. Then I checked /var/log/boot.log and executed "systemctl status NetworkManager-wait-online.service". Neither indicated a failure.
Did I miss something? Guidance appreciated.

(corrected path to mythtv-backend.service 5/31/22)
Last edited by Revilo on Tue May 31, 2022 8:26 pm, edited 3 times in total.
User avatar
bill6502
Developer
Posts: 2308
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: v32 - running mythtv-setup with no changes required after system reboot

Post by bill6502 »

OK, HDHRs. There are a number of solutions, but the idea is to repeatedly try to connect to
the HDHR 'til it's up. Here's mine: https://pastebin.com/raw/sPER8826

Install the above in /usr/local/bin/hdhomerun_check.py, Then create an override for the backend
with this: sudo -E systemctl edit mythtv-backend.service

That will start in your preferred editor and create a proper override file. Add this in the file, save and exit:

Code: Select all

[Service]
ExecStartPre=/usr/local/bin/hdhomerun_check.py
Run the previous tests and the backend won't start 'til the HDHR is detected. I've
seen mine take up to 14 seconds. Note that by default a log is created in /tmp.

By the way, I've never heard of the pingnetwork.service. But I'm a Ubuntu user.
Revilo
Junior
Posts: 15
Joined: Sat May 21, 2022 2:38 am
United States of America

Re: v32 - running mythtv-setup with no changes required after system reboot

Post by Revilo »

Thanks again. Sorry for not providing HD Homerun detail to begin with.

FYI, I got the pingnetwork.service bit from the document you linked in your first reply in the section headed "Delay starting the backend until network has initialized".

Link modified below to point directly to section.
https://www.mythtv.org/wiki/Systemd_myt ... nitialized
Revilo
Junior
Posts: 15
Joined: Sat May 21, 2022 2:38 am
United States of America

Re: v32 - running mythtv-setup with no changes required after system reboot

Post by Revilo »

Thank you for all the help and sharing your python script. I saved it off locally. For now based on the original doc you pointed me to I added the following to the overide and it is working so far.

Code: Select all

[Service]
ExecStartPre=/bin/sleep 20
And I am not seeing a noticeable impact on boot time. The problem seems to be solved.
User avatar
bill6502
Developer
Posts: 2308
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: [Solved] v32 - running mythtv-setup with no changes required after system reboot

Post by bill6502 »

Good to hear. Should you ever choose, the value of scripts/programs that repeatedly
attempt to 'talk to' the HDHR is that on restarting a backend host (as opposed to a cold
start), the mythtv-backend service will start quicker.
Post Reply