diff options
Diffstat (limited to 'package/rpi-userland/S94vcfiled')
-rwxr-xr-x | package/rpi-userland/S94vcfiled | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/package/rpi-userland/S94vcfiled b/package/rpi-userland/S94vcfiled new file mode 100755 index 0000000000..9a3e523d3b --- /dev/null +++ b/package/rpi-userland/S94vcfiled @@ -0,0 +1,47 @@ +#!/bin/sh + +NAME=vcfiled +DESC="VideoCore file server daemon $NAME" +DAEMON="/usr/sbin/$NAME" +DAEMON_ARGS="" +CFGFILE="/etc/default/$NAME" +PIDFILE="/var/run/$NAME.pid" + +# Read configuration variable file if it is present +[ -r "$CFGFILE" ] && . "$CFGFILE" + +do_start() +{ + echo -n "Starting $DESC: " + start-stop-daemon -S -q -p "$PIDFILE" -x "$DAEMON" -- $DAEMON_ARGS && + echo "done" || echo "failed" +} + +do_stop() +{ + echo -n "Stopping $DESC: " + if start-stop-daemon -K -q -R TERM/30/KILL/5 -p "$PIDFILE" -n "$NAME"; then + # This daemon does not remove its PID file when it exits. + rm -f "$PIDFILE" + echo "done" + else + echo "failed" + fi +} + +case "$1" in + start) + do_start + ;; + stop) + do_stop + ;; + restart|reload) + do_stop + do_start + ;; + *) + echo "Usage: $0 {start|stop|restart|reload}" >&2 + exit 1 + ;; +esac |