media-tv/tvheadend: Fix systemd service unit
authorJames Le Cuirot <chewi@gentoo.org>
Sun, 2 Sep 2018 11:19:36 +0000 (12:19 +0100)
committerJames Le Cuirot <chewi@gentoo.org>
Sun, 2 Sep 2018 11:43:08 +0000 (12:43 +0100)
I haven't tested this as I don't use systemd.

Closes: https://bugs.gentoo.org/654346
Package-Manager: Portage-2.3.48, Repoman-2.3.10

media-tv/tvheadend/files/tvheadend.service

index 2d0573ca910f6e18f6365b799d75272bc1a3157a..6d1e27445b734e6c3fa104610cacc27b2dc57559 100644 (file)
@@ -3,19 +3,22 @@ Description=tvheadend
 After=network.target
 
 [Service]
-Type=forking
+Type=simple
 User=tvheadend
 Group=video
 RuntimeDirectory=tvheadend
 PIDFile=/run/tvheadend/tvheadend.pid
-ExecStart=/usr/bin/tvheadend -6 -f -p /run/tvheadend.pid -C -c /etc/tvheadend
+EnvironmentFile=/etc/conf.d/tvheadend
+ExecStart=/usr/bin/tvheadend -p /run/tvheadend/tvheadend.pid -c "${TVHEADEND_CONFIG}" ${TVHEADEND_OPTIONS}
+TimeoutStartSec=1m
+TimeoutStopSec=20s
 Restart=always
-RestartSec=5
+RestartSec=5s
 DevicePolicy=closed
-DeviceAllow=char-DVB rw # DVB devices
-DeviceAllow=char-drm rw # GPUs for transcoding
+DeviceAllow=char-DVB rw
+DeviceAllow=char-drm rw
 RestrictAddressFamilies=AF_INET AF_INET6
-ProtectSystem=strict
+ProtectSystem=yes
 ProtectHome=yes
 NoNewPrivileges=yes