[mythtv-users] Slave backend reboot procedure

Jan Ceuleers jan.ceuleers at gmail.com
Mon Mar 25 15:47:35 UTC 2019


On 25/03/2019 10:22, Stuart Auchterlonie wrote:
> It could be coming online before the networking is available
> and therefore doesn't come up properly.
> 
> You've no said what distro you are running on, so depending on
> which one, and whether it's systemd, you may need to
> a) verify this is the issue
> b) work out how to ensure the slave backend service is started
>    after networking is online.

Stuart,

Thanks. It's Ubuntu 16.04, i.e. with systemd. Here is the service file
on the slave backend:

# cat /etc/systemd/system/mythtv-backend.service
# JCE modified this file:
# 1. set StartLimitInterval to 0 (was 10m)
# 2. add dependency on videop* devices
# 3. drop mysql.service dependency (since this is a slave backend)

[Unit]
Description=MythTV Backend
Documentation=https://www.mythtv.org/wiki/Mythbackend
After=network.target dev-videop2.device dev-videop3.device
dev-videop5.device
wants=dev-videop2.device dev-videop3.device dev-videop5.device

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

[Install]
WantedBy=multi-user.target


And on the master backend:

# cat /etc/systemd/system/mythtv-backend.service
# JCE modified this file:
# 1. set StartLimitInterval to 0 (was 10m)
# 2. add dependency on videop* devices

[Unit]
Description=MythTV Backend
Documentation=https://www.mythtv.org/wiki/Mythbackend
After=mysql.service network.target dev-videop0.device dev-videop1.device
Wants=dev-videop0.device dev-videop1.device

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

[Install]
WantedBy=multi-user.target


The /dev/videop* devices are created by udev rules (the p stands for
persistent) based on the tuners' serial numbers:

# cat /etc/udev/rules.d/10-JCE-persistent-tuner.rules
# Create a persistent name /dev/videop0 to tuner SN 7300-00-F06D3877
SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*",
ATTRS{manufacturer}=="Hauppauge", ATTRS{product}=="WinTV",
ATTRS{serial}=="7300-00-F06D3877", SYMLINK+="videop0"

# Create a persistent name /dev/videop1 to tuner SN 7300-00-F06C9907
SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*",
ATTRS{manufacturer}=="Hauppauge", ATTRS{product}=="WinTV",
ATTRS{serial}=="7300-00-F06C9907", SYMLINK+="videop1"

# Create a persistent name /dev/videop2 to tuner SN 7300-00-F06EFBC0 old
# Create a persistent name /dev/videop2 to tuner SN 7300-00-F082CB8C
SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*",
ATTRS{manufacturer}=="Hauppauge", ATTRS{product}=="WinTV",
ATTRS{serial}=="7300-00-F082CB8C", SYMLINK+="videop2"

# Create a persistent name /dev/videop3 to tuner SN 7300-00-F07801CC
SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*",
ATTRS{manufacturer}=="Hauppauge", ATTRS{product}=="WinTV",
ATTRS{serial}=="7300-00-F07801CC", SYMLINK+="videop3"

# Create a persistent name /dev/videop5 to tuner SN 7300-00-F0000002
SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*",
ATTRS{manufacturer}=="Hauppauge", ATTRS{product}=="WinTV",
ATTRS{serial}=="7300-00-F0000002", SYMLINK+="videop5"


The creation of the device nodes is also signaled to systemd thusly:

# cat /etc/udev/rules.d/99-mythbackend.rules
#
# Create systemd device units for capture devices
#
# JCE: From https://www.mythtv.org/wiki/Systemd_mythbackend_Configuration
#
SUBSYSTEM=="video4linux", TAG+="systemd"
SUBSYSTEM=="dvb", TAG+="systemd"
SUBSYSTEM=="firewire", TAG+="systemd"

Thanks, Jan


More information about the mythtv-users mailing list