summaryrefslogtreecommitdiffstats
path: root/main/vlc/vlc.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/vlc/vlc.initd')
-rwxr-xr-xmain/vlc/vlc.initd24
1 files changed, 17 insertions, 7 deletions
diff --git a/main/vlc/vlc.initd b/main/vlc/vlc.initd
index 11567dcd8..8fe3b4866 100755
--- a/main/vlc/vlc.initd
+++ b/main/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 $?
}
-