aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@alpinelinux.org>2018-12-28 23:09:50 +0000
committerCarlo Landmeter <clandmeter@alpinelinux.org>2018-12-28 23:10:39 +0000
commit431dea891b3aa55b15eef013966267257a3b295e (patch)
treeef6f9dda9c9da335ec4a64abce6a0315fd31a358 /community
parent5a7e6b2c5738e229983bb88fbcaf3d5450e5508c (diff)
downloadaports-431dea891b3aa55b15eef013966267257a3b295e.tar.bz2
aports-431dea891b3aa55b15eef013966267257a3b295e.tar.xz
community/tvheadend: update initd to use supervise-daeon
Diffstat (limited to 'community')
-rw-r--r--community/tvheadend/APKBUILD21
-rw-r--r--community/tvheadend/tvheadend.confd7
-rw-r--r--community/tvheadend/tvheadend.initd21
3 files changed, 25 insertions, 24 deletions
diff --git a/community/tvheadend/APKBUILD b/community/tvheadend/APKBUILD
index 77a18d711f..badb13b637 100644
--- a/community/tvheadend/APKBUILD
+++ b/community/tvheadend/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=tvheadend
pkgver=4.2.7
-pkgrel=1
+pkgrel=2
pkgdesc="TV Streaming server for linux"
url="http://tvheadend.org/"
arch="all"
@@ -22,7 +22,6 @@ subpackages="$pkgname-doc $pkgname-openrc
source="$pkgname-$pkgver.tar.gz::https://github.com/tvheadend/tvheadend/archive/v$pkgver.tar.gz
https://dev.alpinelinux.org/archive/tvheadend/satellites-20180626.xml
$pkgname.initd
- $pkgname.confd
"
builddir="$srcdir/tvheadend-$pkgver"
@@ -55,16 +54,15 @@ check() {
}
package() {
- cd "$builddir"
+ cd "$builddir"
make -j1 DESTDIR="$pkgdir" install
- install -m755 -D "$srcdir"/$pkgname.initd \
+ install -m 755 -D "$srcdir"/$pkgname.initd \
"$pkgdir"/etc/init.d/$pkgname
- install -m644 -D "$srcdir"/$pkgname.confd \
- "$pkgdir"/etc/conf.d/$pkgname
- # /usr/bin/install seems to fail to apply ownership
- # when running from abuild on aarch64
- mkdir -p "$pkgdir"/etc/"$pkgname"
- chown "$pkgusers:$pkggroups" "$pkgdir/etc/$pkgname"
+ install -d -m 755 -o $pkgusers -g $pkggroups \
+ "$pkgdir"/etc/tvheadend
+ install -d -m 755 -o $pkgusers -g $pkggroups \
+ "$pkgdir"/var/lib/tvheadend \
+ "$pkgdir"/var/log/tvheadend
}
dvb_scan() {
@@ -88,5 +86,4 @@ satellites_xml() {
sha512sums="14dd4f452a785359614e2dfe3c210543e0bddf011b8bb994a282cfcff3f3e2573e48636e4c778c7fea39c01318053211e674911fcec3ad5f7b536bdd9e5f5aa9 tvheadend-4.2.7.tar.gz
d0f0b090ee5bf084a478bb35c944d8e008d300d29db2a8dea3feadeee6226da0eff154ccee482fc10beab30a0b6fc176d5b7578f21fa187d3ea091f599621752 satellites-20180626.xml
-db275e263d52d0515544cc52836d99d1cf43b7c17a8037f897d5788e770b69be85cb709f71e7fae4d66c4a2cef8c4f9533fc2ab41490776ee437e4db4d27fa31 tvheadend.initd
-dd55c56ffb0b090fc03537556340ac0dd17741d2ce9eeabb388af43b566e2764385affc2e4457fa7a6d94e44c491d7cf43c6b6d89dc1ba60dd9724cc488c0ef1 tvheadend.confd"
+8b6463996b9635654cba4458e58cef2970e31c98c1469ccc694276e5542eec451a0859a972b6c056b53d97deb2cef55d701fb1ee3ca980b1606f9126a88ab64f tvheadend.initd"
diff --git a/community/tvheadend/tvheadend.confd b/community/tvheadend/tvheadend.confd
deleted file mode 100644
index 54aaf955b3..0000000000
--- a/community/tvheadend/tvheadend.confd
+++ /dev/null
@@ -1,7 +0,0 @@
-# config directory
-TVHCONF="/etc/tvheadend-git"
-# pidfile
-TVHPID=/var/run/tvheadend-git.pid
-# addititonal arguments
-# use -C at first run
-TVHARGS=""
diff --git a/community/tvheadend/tvheadend.initd b/community/tvheadend/tvheadend.initd
index a4ac31084a..90ae77e258 100644
--- a/community/tvheadend/tvheadend.initd
+++ b/community/tvheadend/tvheadend.initd
@@ -1,14 +1,25 @@
#!/sbin/openrc-run
+name="Tvheadend"
+supervisor=supervise-daemon
+log_file="/var/log/tvheadend/tvheadend.log"
+supervise_daemon_args="--stdout $log_file --stderr $log_file"
command="/usr/bin/tvheadend"
-command_args="-f -c $TVHCONF -u tvheadend -g video -p $TVHPID $TVHARGS"
-retry="TERM/30/KILL/5"
-pidfile=$TVHPID
-name="tvheadend-git"
-required_dirs=$TVHCONF
+command_args="-c /etc/tvheadend $TVH_ARGS"
+command_user="tvheadend:video"
+pidfile=/run/tvheadend.pid
depend() {
use logger dns
need net
after firewall
}
+
+start_pre() {
+ if [ ! -f /etc/tvheadend/config ]; then
+ ewarn "No configuration found!"
+ ewarn "Configure tvheadend and setup a user via web interface and restart this service!"
+ command_args="$command_args --firstrun"
+ fi
+}
+