Delay backend startup for device detection with systemd
Posted: Thu Nov 22, 2018 4:43 pm
fter upgrading my (0.28) backend to Ubuntu 16.04 it would not reliably use all tuners. The backend service was starting before udev had detected all USB devices and created symlinks for them.
Creating this systemd configuration file will delay the start of the backend service until udev has settled:
# file /etc/systemd/system/mythtv-backend.service.d/mythtv-backend.conf
# Delay mythtv backend start until all tuners have been detected
[Unit]
After=systemd-udev-settle
EDIT: Add errors from mythbackend.log
Jan 4 10:15:19 tv mythbackend: mythbackend[1385]: W CoreContext recorders/dvbchannel.cpp:245 (Open) DVBChan[1](/dev/dvb/adapter_pctv/frontend0): Opening DVB frontend device failed.#012#011#011#011eno: No such file or directory (2)
Jan 4 10:15:19 tv mythbackend: mythbackend[1385]: E CoreContext recorders/dvbchannel.cpp:250 (Open) DVBChan[1](/dev/dvb/adapter_pctv/frontend0): Failed to open DVB frontend device due to fatal error or too many attempts.
Jan 4 10:15:19 tv mythbackend: mythbackend[1385]: E CoreContext recorders/channelbase.cpp:871 (CreateChannel) ChannelBase: CreateChannel() Error: Failed to open device /dev/dvb/adapter_pctv/frontend0
Jan 4 10:15:19 tv mythbackend: mythbackend[1385]: E CoreContext main_helpers.cpp:202 (setupTVs) Problem with capture cards. Card 1 failed init
Creating this systemd configuration file will delay the start of the backend service until udev has settled:
# file /etc/systemd/system/mythtv-backend.service.d/mythtv-backend.conf
# Delay mythtv backend start until all tuners have been detected
[Unit]
After=systemd-udev-settle
EDIT: Add errors from mythbackend.log
Jan 4 10:15:19 tv mythbackend: mythbackend[1385]: W CoreContext recorders/dvbchannel.cpp:245 (Open) DVBChan[1](/dev/dvb/adapter_pctv/frontend0): Opening DVB frontend device failed.#012#011#011#011eno: No such file or directory (2)
Jan 4 10:15:19 tv mythbackend: mythbackend[1385]: E CoreContext recorders/dvbchannel.cpp:250 (Open) DVBChan[1](/dev/dvb/adapter_pctv/frontend0): Failed to open DVB frontend device due to fatal error or too many attempts.
Jan 4 10:15:19 tv mythbackend: mythbackend[1385]: E CoreContext recorders/channelbase.cpp:871 (CreateChannel) ChannelBase: CreateChannel() Error: Failed to open device /dev/dvb/adapter_pctv/frontend0
Jan 4 10:15:19 tv mythbackend: mythbackend[1385]: E CoreContext main_helpers.cpp:202 (setupTVs) Problem with capture cards. Card 1 failed init