From ad6eacc565efb2da52fa9345883ce182a51d0c96 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 7 Mar 2012 10:55:31 +0000 Subject: testing/vlc: fix init.d script for vlc-daemon --- testing/vlc/APKBUILD | 2 +- testing/vlc/vlc.confd | 10 +++++++--- testing/vlc/vlc.initd | 24 +++++++++++++++++------- 3 files changed, 25 insertions(+), 11 deletions(-) (limited to 'testing') diff --git a/testing/vlc/APKBUILD b/testing/vlc/APKBUILD index b9e9dc8771..578b085dda 100644 --- a/testing/vlc/APKBUILD +++ b/testing/vlc/APKBUILD @@ -3,7 +3,7 @@ pkgname=vlc pkgver=2.0.0 _pkgver=${pkgver/_/-} -pkgrel=1 +pkgrel=2 pkgdesc="A multi-platform MPEG, VCD/DVD, and DivX player" pkgusers="vlc" pkggroups="vlc" diff --git a/testing/vlc/vlc.confd b/testing/vlc/vlc.confd index c42344b606..9a58842bd6 100644 --- a/testing/vlc/vlc.confd +++ b/testing/vlc/vlc.confd @@ -1,11 +1,15 @@ # Sample vlc params suitable for running as a daemon -## --daemon detach from prompt ## --file-logging enable file logging ## --logfile logfile name/path ## -vvv verbose logging ## -I dummy disable X11 interface ## --sout PARAMS encoding parameters -## Do NOT quote 'PARAMS' otherwise shell expansions will broke vlc -VLC_OPTS="-vvv -I dummy alsa://hw:0,0 --daemon --file-logging --logfile /var/log/vlc/vlc.log --sout #transcode{acodec=mp3,ab=48,channels=1,samplerate=22050}:std{access=http,mux=ogg,dst=:8080}" + +## Do NOT quote 'PARAMS' otherwise shell expansions will broke vlc +## +## The --daemon option will automatically be added so no need to add it +## here. + +VLC_OPTS="--quiet -I dummy alsa://hw:0,0 --file-logging --logfile /var/log/vlc/vlc.log --sout #transcode{acodec=mp3,ab=48,channels=1,samplerate=22050}:std{access=http,mux=ogg,dst=:8080}" diff --git a/testing/vlc/vlc.initd b/testing/vlc/vlc.initd index 11567dcd86..8fe3b48660 100755 --- a/testing/vlc/vlc.initd +++ b/testing/vlc/vlc.initd @@ -1,22 +1,32 @@ #!/sbin/runscript +description="VideoLAN daemon" +pidfile="/var/run/vlc/${RC_SVCNAME}.pid" +command="/usr/bin/vlc" + depend() { need net + after firewall +} + +start_pre() { + checkpath --directory --owner vlc:vlc --mode 775 ${pidfile%/*} } start() { - ebegin "Starting VLC" + ebegin "Starting ${RC_SVCNAME}" start-stop-daemon --start \ --user vlc \ - --exec /usr/bin/vlc -- ${VLC_OPTS} + --pidfile ${pidfile} \ + --exec ${command} \ + -- \ + --daemon --pidfile ${pidfile} ${VLC_OPTS} eend $? } -stop () { - ebegin "Stopping VLC" +stop() { + ebegin "Stopping ${RC_SVCNAME}" start-stop-daemon --stop \ - --signal KILL \ - --exec /usr/bin/vlc + --pidfile ${pidfile} eend $? } - -- cgit v1.2.3