# Copyright 2011 Lucian Muresan # Distributed under the terms of the GNU General Public License v2 [Unit] Description=Video Disk Recorder Daemon After=lircd.service Requires=alsasound.service Requires=udev.service DefaultDependencies=no [Service] # this will collect the parameters and set them into # the VDR_OPTS variable in the EnvironmentFile, but also # run the whole addons/plugins scripts required before starting # VDR as it's also usually done with OpenRC ExecStartPre=/etc/systemd/scripts/vdr_helper.sh --start-pre # this is where we get our parameters (still manageable # in the /etc/conf.d/vdr.* files EnvironmentFile=/var/vdr/tmp/cmd_params # start VDR with our desired parameters, please disable the # internal watchdog by setting the timeout to 0 ExecStart=/usr/bin/vdr $VDR_OPTS # execute addons/plugins scripts meant to be run afer starting ExecStartPost=/etc/systemd/scripts/vdr_helper.sh --start-post # execute addons/plugins scripts meant to be run before stopping ExecStop=/etc/systemd/scripts/vdr_helper.sh --stop-pre # terminate VDR ... hmm, seems not to be needed, systemd does it anyway # ExecStop=/usr/bin/killall -9 /usr/bin/vdr # execute final scripts ExecStopPost=/etc/systemd/scripts/vdr_helper.sh --stop-post Restart=always [Install] WantedBy=multi-user.target