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

Stephen Worthington stephen_agent at jsw.gen.nz
Tue Jul 28 05:07:29 UTC 2020


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 at 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".


More information about the mythtv-users mailing list