a70e0ae67d3ce3a5b455735442adcaf90644ea82
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / rpi-userland / S94vcfiled
1 #!/bin/sh
2
3 NAME=vcfiled
4 DESC="VideoCore file server daemon $NAME"
5 DAEMON="/usr/sbin/$NAME"
6 DAEMON_ARGS=""
7 CFGFILE="/etc/default/$NAME"
8 PIDFILE="/var/run/$NAME.pid"
9
10 # Read configuration variable file if it is present
11 [ -r "$CFGFILE" ] && . "$CFGFILE"
12
13 start()
14 {
15         echo -n "Starting $DESC: "
16         start-stop-daemon -S -q -p "$PIDFILE" -x "$DAEMON" -- $DAEMON_ARGS &&
17                         echo "done" || echo "failed"
18 }
19
20 stop()
21 {
22         echo -n "Stopping $DESC: "
23         if start-stop-daemon -K -q -R TERM/30/KILL/5 -p "$PIDFILE" -n "$NAME"; then
24                 # This daemon does not remove its PID file when it exits.
25                 rm -f "$PIDFILE"
26                 echo "done"
27         else
28                 echo "failed"
29         fi
30 }
31
32 case "$1" in
33         start)
34                 start
35                 ;;
36         stop)
37                 stop
38                 ;;
39         restart|reload)
40                 stop
41                 start
42                 ;;
43         *)
44                 echo "Usage: $0 {start|stop|restart|reload}" >&2
45                 exit 1
46                 ;;
47 esac