summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Väth <martin@mvath.de>2015-10-21 18:39:35 +0200
committerMartin Väth <martin@mvath.de>2015-10-21 18:39:35 +0200
commit823341961fd7b0a6383afe739bbc7cd4765ae6f4 (patch)
tree2ed3e99a15ad3e62190c5b2bffabcfea9e74b65d /media-tv
parentapp-shells/zsh-syntax-highlighting: Version bump (diff)
downloadmv-823341961fd7b0a6383afe739bbc7cd4765ae6f4.tar.gz
mv-823341961fd7b0a6383afe739bbc7cd4765ae6f4.tar.bz2
mv-823341961fd7b0a6383afe739bbc7cd4765ae6f4.zip
media-tv/sundtek-tv: Add timeout to openrc init
Diffstat (limited to 'media-tv')
-rw-r--r--media-tv/sundtek-tv/files/sundtek.initd16
-rw-r--r--media-tv/sundtek-tv/sundtek-tv-151010.162411-r1.ebuild (renamed from media-tv/sundtek-tv/sundtek-tv-151010.162411.ebuild)2
2 files changed, 16 insertions, 2 deletions
diff --git a/media-tv/sundtek-tv/files/sundtek.initd b/media-tv/sundtek-tv/files/sundtek.initd
index 315da43e..fb374f43 100644
--- a/media-tv/sundtek-tv/files/sundtek.initd
+++ b/media-tv/sundtek-tv/files/sundtek.initd
@@ -4,14 +4,26 @@ description="sundtek TV mediaclient"
#command=/opt/bin/mediasrv
#command_args="-d --pluginpath /opt/bin"
+set_preload() {
+ yesno ${preload:-NO} || return 0
+ LD_PRELOAD=${preload_lib:-/usr/lib}/libmediaclient.so${LD_PRELOAD:+ }${LD_PRELOAD-}
+ export LD_PRELOAD
+}
+
start() {
ebegin "Starting ${SVCNAME}"
- /opt/bin/mediaclient --start=4
+ (
+ set_preload
+ /opt/bin/mediaclient --start=4
+ )
eend $?
}
stop() {
ebegin "Stopping ${SVCNAME}"
- /opt/bin/mediaclient --shutdown
+ (
+ set_preload
+ timeout -k "${killtime:-15}" "${termtime:-15}" /opt/bin/mediaclient --shutdown
+ )
eend $?
}
diff --git a/media-tv/sundtek-tv/sundtek-tv-151010.162411.ebuild b/media-tv/sundtek-tv/sundtek-tv-151010.162411-r1.ebuild
index 2025ee3f..26d24798 100644
--- a/media-tv/sundtek-tv/sundtek-tv-151010.162411.ebuild
+++ b/media-tv/sundtek-tv/sundtek-tv-151010.162411-r1.ebuild
@@ -116,7 +116,9 @@ src_prepare() {
>etc/revdep-rebuild/50-sundtek-tv
if use ld-preload-file
then echo "/${mylibdir}/libmediaclient.so" >etc/ld.so.preload
+ else sed -i -e 's/preload:-NO/preload:-YES/' sundtek.initd
fi
+ sed -i -e "s'preload_lib:-/usr/lib'preload_lib:-/${mylibdir}'" sundtek.initd
if use ld-preload-env
then mkdir etc/env.d
echo "LD_PRELOAD=\"/${mylibdir}/libmediaclient.so\"" >etc/env.d/50sundtek-tv