Nachfolgend meine systemd scripts für den vtuner-ng die ich auf meinen Server zusammen mit den vdr/vtuner-ng Packeten aus dem seahawk repositorys verwende.
Unit /etc/systemd/system/vtunerc.service verwaltet das Kernel module.
Es verwendet die Variable DEVICES aus der Konfigurationsdatei /etc/satip-vtuner/base.conf
[Unit]
Description=vtuner kernel module loader
Before=vdr.service
[Service]
Type=exec
EnvironmentFile=/etc/satip-vtuner/base.conf
ExecStart=/usr/sbin/modprobe vtunerc devices=${DEVICES}
ExecStop=/usr/sbin/modprobe -r vtunerc
RemainAfterExit=true
[Install]
WantedBy=vdr.service
Display More
Template unit /etc/systemd/system/satip@.service verwaltet die satip daemon(s).
Es verwendet die Variablen SERVER, BOPTS, OPTS aus der Konfigurationsdatei /etc/satip-vtuner/base.conf sowie optional aus
/etc/satip-vtuner/vtunercX.conf
[Unit]
Description=satip vtuner daemon
PartOf=vtunerc.service
Wants=network-online.target
After=network-online.target
Before=vdr.service
[Service]
Type=exec
EnvironmentFile=/etc/satip-vtuner/base.conf
EnvironmentFile=-/etc/satip-vtuner/%i.conf
ExecStart=/usr/bin/satip -s ${SERVER} -d /dev/%i $BOPTS $OPTS
Restart=always
RestartSec=5
Display More
und als Bindeglied der beiden Services die udev rules Datei /etc/udev/rules.d/50-vtunerc.rules
# assign group video to vtunerc device and trigger systemd satip daemon service instance
ACTION=="add", SUBSYSTEM=="vtuner", KERNEL=="vtunerc[0-7]", GROUP="video", MODE="0660", TAG+="systemd", ENV{SYSTEMD_WANTS}="satip@$name.service"
Die Konfiguration in der Datei /etc/satip-vtuner/base.conf
# basic configuration loaded by vtuner and satip service units
# within devices specific configuration files e.g. vtunerc1.conf these values could be overridden
# Number of vtuner devices
DEVICES=4
# Hostname/IP-Adress of SATIP-Server
SERVER=192.168.50.9
# basic additional command line options for satip daemon
BOPTS=-u vdr -l 1
# additional command line options for satip daemon. Should be overridden in device specific configuration files
OPTS=
Display More
Gesteuert werden kann das ganze mit:
systemctl start|stop|enable|disable vtunerc
Have fun!