[mythtv-users] udev and systemd requirements for MythTV on Ubuntu 20.04?

Stephen Worthington stephen_agent at jsw.gen.nz
Tue Jul 28 02:00:39 UTC 2020


On Mon, 27 Jul 2020 14:09:18 -0400, you wrote:

>
>On 7/27/20 12:34 PM, James Abernathy wrote:
>>
>>
>>     You will have created those udev rules and the override file manually.
>>
>>     Those udev rules create the .device targets.  The reason for having
>>     those targets is that it is possible for mythbackend to start before
>>     the tuners are created, and having it wait on the device targets
>>     prevents that.  If mythbackend starts before a tuner is working, when
>>     it tests the tuner at startup that tuner will not work and mythbackend
>>     will mark it as failed and not test it again until the next startup of
>>     mythbackend.
>>
>>     If you only have the one tuner in the 20.04 system, you need to
>>     comment out all the Wants/After lines referring to non-existent
>>     tuners.  Otherwise mythbackend will only start after a very long
>>     timeout waiting for those tuners.
>>
>> It was very interesting when I deleted all my backend tuners recently 
>> and added them back in on my 18.04 v31 system, I ended up with only 
>> one adapter name and when I added all 4 there was only one name 
>> repeated 4 times.
>>
>>     If you are using networked tuners such as HDHomeruns, you should have
>>     one of the fixes (such as mine) that prevents mythbackend from
>>     starting before the network us up enough for it to access the
>>     networked tuners.  Waiting for NetworkManager-wait-online.service is
>>     not sufficient to ensure that, and each version of Ubuntu tends to
>>     start up faster than the previous version, so mythbackend is getting
>>     started earlier and earlier.  So if it was working OK without such a
>>     fix in 18.04, it may not in 20.04.  It is best to use something that
>>     pings a networked tuner before it allows mythbackend to be started.
>>     Search this list's archives for "wait-until-pingable.py" to find the
>>     threads for my fix.
>>
>>     And the speed of the SSD you have the system on also affects the
>>     startup speed.  A new system with a super fast M.2 NVMe SSD and lots
>>     of RAM can cause interesting surprises with how fast things start up.
>>
>> So it sounds like for 20.04, I'll continue to create the udev rules 
>> and to be safe put back in the wait-for-ping stuff I had back in the 
>> v29 days.
>>
>> I also noticed that Hauppauge Linux has added Ubuntu 20.04 to their 
>> list on supported O/S's on their PPA 
>> (https://hauppauge.com/pages/support/support_linux.html)
>> Jim A
>
>Stephen,
>
>So I've created the wait-for-ping stuff from your server. Do I still 
>need my override conf file with:
>
>    [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
>
>
>My guess is I don't need the After=NetworkManager-wait-online.serivce 
>since I have the wait for ping stuff.
>
>Jim A

It is likely that the HDHR will be the last thing that is ready, so
all the others should happen before then.  But it is a bad idea to
make assumptions like that.  Things change, and race conditions are
tricky things, so it is always best to set things up to wait for all
the necessary conditions before starting.  So you should keep all
those other After conditions.  And if you should ever stop using the
HDHR, then it is useful to have all the other conditions still in
place so you can just remove the ones for the HDHR and it will still
work correctly.

You can have as many override files as you like.  The only
requirements for them is that the name end in .conf and that they have
the right ownership and permissions.  So if you like, you can have one
for the ping, and one for the previously added stuff.  Then you can
give them names to tell you what each one is there for.  They are used
in collating sequence order.  To see the end result, use this command:

sudo systemctl cat mythtv-backend


More information about the mythtv-users mailing list