2014-08-07 17:24:28 +02:00
|
|
|
#!/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"
|
|
|
|
|
2014-12-12 08:41:53 +01:00
|
|
|
start()
|
2014-08-07 17:24:28 +02:00
|
|
|
{
|
|
|
|
echo -n "Starting $DESC: "
|
|
|
|
start-stop-daemon -S -q -p "$PIDFILE" -x "$DAEMON" -- $DAEMON_ARGS &&
|
|
|
|
echo "done" || echo "failed"
|
|
|
|
}
|
|
|
|
|
2014-12-12 08:41:53 +01:00
|
|
|
stop()
|
2014-08-07 17:24:28 +02:00
|
|
|
{
|
|
|
|
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)
|
2014-12-12 08:41:53 +01:00
|
|
|
start
|
2014-08-07 17:24:28 +02:00
|
|
|
;;
|
|
|
|
stop)
|
2014-12-12 08:41:53 +01:00
|
|
|
stop
|
2014-08-07 17:24:28 +02:00
|
|
|
;;
|
|
|
|
restart|reload)
|
2014-12-12 08:41:53 +01:00
|
|
|
stop
|
|
|
|
start
|
2014-08-07 17:24:28 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: $0 {start|stop|restart|reload}" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|