Mailing List Archive

udev and systemd requirements for MythTV on Ubuntu 20.04?
I'm doing some planning for moving from MythTV v31 on Ubuntu 18.04 to
MythTV v31 on Ubuntu 20.04. There are a lot of considerations, like my
current system using MariaDB and the current issue regarding that on Ubuntu
20.04.

However, my concerns today are related to udev rules and systemd overrides.

On my 18.04 system, I have one udev rule related to mythtv;
99-mythbackend.rules

SUBSYSTEM=="video4linux", TAG+="systemd"
SUBSYSTEM=="dvb", TAG+="systemd"
SUBSYSTEM=="firewire", TAG+="systemd"

When I installed mythtv v31 on a virtual machine of Ubuntu 20.04, this file
was not there. I probably created it myself because of the Hauppauge WinTV
HD Quad PCIe tuner card I was using.

So is this still necessary for Ubuntu 20.04 and mythtv v31?

Also, on my current system I have an override file in
/etc/systemd/system/mythtv-backend.service.d/ythtv-backend-override.conf:
[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

I figure this is also related to the Hauppauge card and also my HDHomerun
tuner.

Again I think I did this back with mythtv29 and it's stayed through the
upgrades to v31.

Do I need any of this in mythtv v31 on Ubuntu 20.04?

On the Ubuntu 20.04 test virtual machine I have only the HDHR tuner and it
works fine but I have no udev rules or systemd override file.

Thoughts?

Jim A
Re: udev and systemd requirements for MythTV on Ubuntu 20.04? [ In reply to ]
On 27/07/2020 15:43, James Abernathy wrote:
> I'm doing some planning for moving from MythTV v31 on Ubuntu 18.04 to
> MythTV v31 on Ubuntu 20.04.  There are a lot of considerations, like
> my current system using MariaDB and the current issue regarding that
> on Ubuntu 20.04.
>
> However, my concerns today are related to udev rules and systemd
> overrides.
>
> On my 18.04 system, I have one udev rule related to mythtv;
> 99-mythbackend.rules
>
> SUBSYSTEM=="video4linux", TAG+="systemd"
> SUBSYSTEM=="dvb", TAG+="systemd"
> SUBSYSTEM=="firewire", TAG+="systemd"
>
> When I installed mythtv v31 on a virtual machine of Ubuntu 20.04, this
> file was not there. I probably created it myself because of the
> Hauppauge WinTV HD Quad PCIe tuner card I was using.
>
> So is this still necessary for Ubuntu 20.04 and mythtv v31?
>
> Also,  on my current system I have an override file in
> /etc/systemd/system/mythtv-backend.service.d/ythtv-backend-override.conf:
> [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
>
> I figure this is also related to the Hauppauge card and also my
> HDHomerun tuner.
>
> Again I think I did this back with mythtv29 and it's stayed through
> the upgrades to v31.
>
> Do I need any of this in mythtv v31 on Ubuntu 20.04?
>
> On the Ubuntu 20.04 test virtual machine I have only the HDHR tuner
> and it works fine but I have no udev rules or systemd override file.
>
> Thoughts?
>
> Jim A
>
Jim,

Yes, you did setup those entries for your PCI-e tuner, they make sure
mythtvbackend starts only when the card has been fully setup during boot.


For network tuners e.g. HDHOMERUN there is a different problem in that
mythtv-backend can start before networking is fully established see
https://lists.gt.net/mythtv/users/625986#625986


Mike

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: udev and systemd requirements for MythTV on Ubuntu 20.04? [ In reply to ]
On Mon, 27 Jul 2020 10:43:53 -0400, you wrote:

>I'm doing some planning for moving from MythTV v31 on Ubuntu 18.04 to
>MythTV v31 on Ubuntu 20.04. There are a lot of considerations, like my
>current system using MariaDB and the current issue regarding that on Ubuntu
>20.04.
>
>However, my concerns today are related to udev rules and systemd overrides.
>
>On my 18.04 system, I have one udev rule related to mythtv;
>99-mythbackend.rules
>
>SUBSYSTEM=="video4linux", TAG+="systemd"
>SUBSYSTEM=="dvb", TAG+="systemd"
>SUBSYSTEM=="firewire", TAG+="systemd"
>
>When I installed mythtv v31 on a virtual machine of Ubuntu 20.04, this file
>was not there. I probably created it myself because of the Hauppauge WinTV
>HD Quad PCIe tuner card I was using.
>
>So is this still necessary for Ubuntu 20.04 and mythtv v31?
>
>Also, on my current system I have an override file in
>/etc/systemd/system/mythtv-backend.service.d/ythtv-backend-override.conf:
>[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
>
>I figure this is also related to the Hauppauge card and also my HDHomerun
>tuner.
>
>Again I think I did this back with mythtv29 and it's stayed through the
>upgrades to v31.
>
>Do I need any of this in mythtv v31 on Ubuntu 20.04?
>
>On the Ubuntu 20.04 test virtual machine I have only the HDHR tuner and it
>works fine but I have no udev rules or systemd override file.
>
>Thoughts?
>
>Jim A

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.

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.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: udev and systemd requirements for MythTV on Ubuntu 20.04? [ In reply to ]
On Mon, Jul 27, 2020 at 11:55 AM Mike Bibbings <mike.bibbings@gmail.com>
wrote:

> On 27/07/2020 15:43, James Abernathy wrote:
> > I'm doing some planning for moving from MythTV v31 on Ubuntu 18.04 to
> > MythTV v31 on Ubuntu 20.04. There are a lot of considerations, like
> > my current system using MariaDB and the current issue regarding that
> > on Ubuntu 20.04.
> >
> > However, my concerns today are related to udev rules and systemd
> > overrides.
> >
> > On my 18.04 system, I have one udev rule related to mythtv;
> > 99-mythbackend.rules
> >
> > SUBSYSTEM=="video4linux", TAG+="systemd"
> > SUBSYSTEM=="dvb", TAG+="systemd"
> > SUBSYSTEM=="firewire", TAG+="systemd"
> >
> > When I installed mythtv v31 on a virtual machine of Ubuntu 20.04, this
> > file was not there. I probably created it myself because of the
> > Hauppauge WinTV HD Quad PCIe tuner card I was using.
> >
> > So is this still necessary for Ubuntu 20.04 and mythtv v31?
> >
> > Also, on my current system I have an override file in
> > /etc/systemd/system/mythtv-backend.service.d/ythtv-backend-override.conf:
> > [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
> >
> > I figure this is also related to the Hauppauge card and also my
> > HDHomerun tuner.
> >
> > Again I think I did this back with mythtv29 and it's stayed through
> > the upgrades to v31.
> >
> > Do I need any of this in mythtv v31 on Ubuntu 20.04?
> >
> > On the Ubuntu 20.04 test virtual machine I have only the HDHR tuner
> > and it works fine but I have no udev rules or systemd override file.
> >
> > Thoughts?
> >
> > Jim A
> >
> Jim,
>
> Yes, you did setup those entries for your PCI-e tuner, they make sure
> mythtvbackend starts only when the card has been fully setup during boot.
>
>
> For network tuners e.g. HDHOMERUN there is a different problem in that
> mythtv-backend can start before networking is fully established see
> https://lists.gt.net/mythtv/users/625986#625986
>
>
> Mike
>

So it seems the udev rules for the PCIe cards are still required in Ubuntu
20.04, right?

I'm aware of the systemd stuff for networked tuners that you linked to. In
fact I had to use that back with v29 when you had to use external recorders
in mythtv-setup in the card section for TCP communication to HDHomerun
tuners, because that software took a while to start up. However, for some
reason when I upgraded to v30/31 I removed that and now am left with what I
showed above.

I know that with my HDHR4-2US and HDHR5-4US networked tuners I don't need
anything in systemd for either Ubuntu 20.04 or Raspberry Pi OS on RPi4.

At least I've been lucky. Everytime I reboot my tuners are available and
working in mythtv-backend without systemd overrides.

Jim A
Re: udev and systemd requirements for MythTV on Ubuntu 20.04? [ In reply to ]
On Mon, Jul 27, 2020 at 12:16 PM Stephen Worthington <
stephen_agent@jsw.gen.nz> wrote:

> On Mon, 27 Jul 2020 10:43:53 -0400, you wrote:
>
> >I'm doing some planning for moving from MythTV v31 on Ubuntu 18.04 to
> >MythTV v31 on Ubuntu 20.04. There are a lot of considerations, like my
> >current system using MariaDB and the current issue regarding that on
> Ubuntu
> >20.04.
> >
> >However, my concerns today are related to udev rules and systemd
> overrides.
> >
> >On my 18.04 system, I have one udev rule related to mythtv;
> >99-mythbackend.rules
> >
> >SUBSYSTEM=="video4linux", TAG+="systemd"
> >SUBSYSTEM=="dvb", TAG+="systemd"
> >SUBSYSTEM=="firewire", TAG+="systemd"
> >
> >When I installed mythtv v31 on a virtual machine of Ubuntu 20.04, this
> file
> >was not there. I probably created it myself because of the Hauppauge WinTV
> >HD Quad PCIe tuner card I was using.
> >
> >So is this still necessary for Ubuntu 20.04 and mythtv v31?
> >
> >Also, on my current system I have an override file in
> >/etc/systemd/system/mythtv-backend.service.d/ythtv-backend-override.conf:
> >[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
> >
> >I figure this is also related to the Hauppauge card and also my HDHomerun
> >tuner.
> >
> >Again I think I did this back with mythtv29 and it's stayed through the
> >upgrades to v31.
> >
> >Do I need any of this in mythtv v31 on Ubuntu 20.04?
> >
> >On the Ubuntu 20.04 test virtual machine I have only the HDHR tuner and it
> >works fine but I have no udev rules or systemd override file.
> >
> >Thoughts?
> >
> >Jim A
>
> 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
Re: udev and systemd requirements for MythTV on Ubuntu 20.04? [ In reply to ]
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
Re: udev and systemd requirements for MythTV on Ubuntu 20.04? [ In reply to ]
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
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: udev and systemd requirements for MythTV on Ubuntu 20.04? [ In reply to ]
On 7/27/20 10:00 PM, Stephen Worthington wrote:
> On Mon, 27 Jul 2020 14:09:18 -0400, you wrote:
>
>
> 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

That's very useful.  Here are my current results:

jim@mythbuntu:~$ sudo systemctl cat mythtv-backend
[sudo] password for jim:
# /lib/systemd/system/mythtv-backend.service
[Unit]
Description=MythTV Backend
Documentation=https://www.mythtv.org/wiki/Mythbackend
After=mysql.service network.target

[Service]
User=mythtv
EnvironmentFile=-/etc/mythtv/additional.args
ExecStart=/usr/bin/mythbackend --quiet --syslog local7 $ADDITIONAL_ARGS
StartLimitBurst=10
StartLimitInterval=10m
Restart=on-failure
RestartSec=1

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/mythtv-backend.service.d/mythtv-backend-override.conf
[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


#
/etc/systemd/system/mythtv-backend.service.d/mythtv-backend-wait-until-pingable.conf
[Unit]
Wants=local-network-pingable.service
After=local-network-pingable.service

Thanks,

Jim A


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: udev and systemd requirements for MythTV on Ubuntu 20.04? [ In reply to ]
On Mon, 27 Jul 2020 22:53:24 -0400, you wrote:

>
>On 7/27/20 10:00 PM, Stephen Worthington wrote:
>> On Mon, 27 Jul 2020 14:09:18 -0400, you wrote:
>>
>>
>> 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
>
>That's very useful.? Here are my current results:
>
>jim@mythbuntu:~$ sudo systemctl cat mythtv-backend
>[sudo] password for jim:
># /lib/systemd/system/mythtv-backend.service
>[Unit]
>Description=MythTV Backend
>Documentation=https://www.mythtv.org/wiki/Mythbackend
>After=mysql.service network.target
>
>[Service]
>User=mythtv
>EnvironmentFile=-/etc/mythtv/additional.args
>ExecStart=/usr/bin/mythbackend --quiet --syslog local7 $ADDITIONAL_ARGS
>StartLimitBurst=10
>StartLimitInterval=10m
>Restart=on-failure
>RestartSec=1
>
>[Install]
>WantedBy=multi-user.target
>
># /etc/systemd/system/mythtv-backend.service.d/mythtv-backend-override.conf
>[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
>
>
>#
>/etc/systemd/system/mythtv-backend.service.d/mythtv-backend-wait-until-pingable.conf
>[Unit]
>Wants=local-network-pingable.service
>After=local-network-pingable.service

That looks good except for one thing - the fix to get mythbackend to
shut down correctly. Due to the bug where one thread fails to shut
down, without the fix mythbackend will continue to be running (doing
nothing with only one thread left waiting on something). Eventually,
after a long timeout (90 seconds I believe unless you have configured
it), systemd will finally do a kill -9. So shutting down or rebooting
the PC takes an extra 90 seconds. With the fix, shutdown of
mythbackend is very rapid (one second?). Instructions for installing
it can be found on this thread:

https://lists.archive.carbon60.com/mythtv/users/627998

Search for "mythbackendstop.sh".
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: udev and systemd requirements for MythTV on Ubuntu 20.04? [ In reply to ]
On 7/28/20 1:07 AM, Stephen Worthington wrote:
> On Mon, 27 Jul 2020 22:53:24 -0400, you wrote:
>
>> On 7/27/20 10:00 PM, Stephen Worthington wrote:
>>> On Mon, 27 Jul 2020 14:09:18 -0400, you wrote:
>>>
>>>
>>> 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
>> That's very useful.  Here are my current results:
>>
>> jim@mythbuntu:~$ sudo systemctl cat mythtv-backend
>> [sudo] password for jim:
>> # /lib/systemd/system/mythtv-backend.service
>> [Unit]
>> Description=MythTV Backend
>> Documentation=https://www.mythtv.org/wiki/Mythbackend
>> After=mysql.service network.target
>>
>> [Service]
>> User=mythtv
>> EnvironmentFile=-/etc/mythtv/additional.args
>> ExecStart=/usr/bin/mythbackend --quiet --syslog local7 $ADDITIONAL_ARGS
>> StartLimitBurst=10
>> StartLimitInterval=10m
>> Restart=on-failure
>> RestartSec=1
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>> # /etc/systemd/system/mythtv-backend.service.d/mythtv-backend-override.conf
>> [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
>>
>>
>> #
>> /etc/systemd/system/mythtv-backend.service.d/mythtv-backend-wait-until-pingable.conf
>> [Unit]
>> Wants=local-network-pingable.service
>> After=local-network-pingable.service
> That looks good except for one thing - the fix to get mythbackend to
> shut down correctly. Due to the bug where one thread fails to shut
> down, without the fix mythbackend will continue to be running (doing
> nothing with only one thread left waiting on something). Eventually,
> after a long timeout (90 seconds I believe unless you have configured
> it), systemd will finally do a kill -9. So shutting down or rebooting
> the PC takes an extra 90 seconds. With the fix, shutdown of
> mythbackend is very rapid (one second?). Instructions for installing
> it can be found on this thread:
>
> https://lists.archive.carbon60.com/mythtv/users/627998
>
> Search for "mythbackendstop.sh".

Thanks to all for the help. The advice must have been good because I
just blew away my old mythbackend on 18.04 and install v31 on a fresh
install of Ubuntu 20.04 and restored the database. That was easy it's
all the little stuff that takes time to do if you remember where you
learned to do them.  That's why I created a new blog with my
instructions to help me the next time Ubuntu LTS changes to the next big
release. FYI, my old system used MariaDB and I successfully use the
daily backend when I restored the database onto the new Mythtv v31 on
20.04 that defaults to MySQL 8

In case you want to help me with typos or mistakes I've got a first
draft at:
https://mythtvinstall.blogspot.com/2020/07/combined-mythtv-v31-media-system-and.html

Once it's reasonable clean, I put a post in the MythTV Forum so newbies
can have one more data point to get started.

Jim A


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org