Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 654346 - media-tv/tvheadend-4.3 Version bump
Summary: media-tv/tvheadend-4.3 Version bump
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: James Le Cuirot
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-29 15:39 UTC by Olliver Schinagl
Modified: 2018-09-02 11:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olliver Schinagl 2018-04-29 15:39:57 UTC
TVHeadend 4.3 has been released nearly a year ago. Everything seems to work except that commit c4919ded3309089 needs to be added ontop to get the systemd flag working.

I don't think systemd support (watchdog) is fully working with 4.3.

The following changes where needed to get the service file working.
For some reason with systemd 236 the comments on a line aren't accepted any longer, ProtectSystem=strict prevents tvheadend to write its own config files in /etc and using -f + forking causes a start failure.

diff --git a/media-tv/tvheadend/files/tvheadend.confd b/media-tv/tvheadend/files/tvheadend.confd
index 8be4a5dadce..2b0e2c73d14 100644
--- a/media-tv/tvheadend/files/tvheadend.confd
+++ b/media-tv/tvheadend/files/tvheadend.confd
@@ -11,4 +11,4 @@ TVHEADEND_GROUP="video"
 TVHEADEND_CONFIG="/etc/tvheadend"

 # Other options you want to pass to Tvheadend.
-TVHEADEND_OPTIONS=""
+TVHEADEND_OPTIONS="-C"
diff --git a/media-tv/tvheadend/files/tvheadend.service b/media-tv/tvheadend/files/tvheadend.service
index 2d0573ca910..e639c92d13b 100644
--- a/media-tv/tvheadend/files/tvheadend.service
+++ b/media-tv/tvheadend/files/tvheadend.service
@@ -1,21 +1,24 @@
 [Unit]
-Description=tvheadend
+Description=Tvheadend - a TV streaming server and DVR
 After=network.target

 [Service]
-Type=forking
+Type=simple
+TimeoutStartSec=5m
+TimeoutStopSec=20s
 User=tvheadend
 Group=video
+EnvironmentFile=/etc/conf.d/tvheadend
 RuntimeDirectory=tvheadend
 PIDFile=/run/tvheadend/tvheadend.pid
-ExecStart=/usr/bin/tvheadend -6 -f -p /run/tvheadend.pid -C -c /etc/tvheadend
+ExecStart=/usr/bin/tvheadend -p /run/tvheadend/tvheadend.pid -c $TVHEADEND_CONFIG $TVHEADEND_OPTIONS
 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
Comment 1 James Le Cuirot gentoo-dev 2018-04-29 16:52:34 UTC
4.3 is marked as a development release, only the even numbered releases are considered stable. If you really want the latest then we do have 9999, which reportedly works well. I will look at your suggestion for 9999 but I don't use systemd so I won't be able to test it.
Comment 2 Larry the Git Cow gentoo-dev 2018-09-02 11:43:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8085f241c486d2e44a04f6e6f65b778a86325b21

commit 8085f241c486d2e44a04f6e6f65b778a86325b21
Author:     James Le Cuirot <chewi@gentoo.org>
AuthorDate: 2018-09-02 11:19:36 +0000
Commit:     James Le Cuirot <chewi@gentoo.org>
CommitDate: 2018-09-02 11:43:08 +0000

    media-tv/tvheadend: Fix systemd service unit
    
    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 | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)