0
|
1 #! /bin/sh
|
|
2 #
|
|
3 # skeleton example file to build /etc/init.d/ scripts.
|
|
4 # This file should be used to construct scripts for /etc/init.d.
|
|
5 #
|
|
6 # Written by Miquel van Smoorenburg <miquels@cistron.nl>.
|
|
7 # Modified for Debian
|
|
8 # by Ian Murdock <imurdock@gnu.ai.mit.edu>.
|
|
9 #
|
|
10 # Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
|
|
11 #
|
|
12
|
|
13 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|
14 DAEMON=/usr/bin/memcached
|
|
15 DAEMONBOOTSTRAP=/usr/share/memcached/scripts/start-memcached
|
|
16 NAME=memcached
|
|
17 DESC=memcached
|
|
18 PIDFILE=/var/run/$NAME.pid
|
|
19
|
|
20 test -x $DAEMON || exit 0
|
|
21 test -x $DAEMONBOOTSTRAP || exit 0
|
|
22
|
|
23 set -e
|
|
24
|
|
25 case "$1" in
|
|
26 start)
|
|
27 echo -n "Starting $DESC: "
|
|
28 start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP
|
|
29 echo "$NAME."
|
|
30 ;;
|
|
31 stop)
|
|
32 echo -n "Stopping $DESC: "
|
|
33 start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
|
|
34 echo "$NAME."
|
|
35 rm -f $PIDFILE
|
|
36 ;;
|
|
37
|
|
38 restart|force-reload)
|
|
39 #
|
|
40 # If the "reload" option is implemented, move the "force-reload"
|
|
41 # option to the "reload" entry above. If not, "force-reload" is
|
|
42 # just the same as "restart".
|
|
43 #
|
|
44 echo -n "Restarting $DESC: "
|
|
45 start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
|
|
46 rm -f $PIDFILE
|
|
47 sleep 1
|
|
48 start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP
|
|
49 echo "$NAME."
|
|
50 ;;
|
|
51 *)
|
|
52 N=/etc/init.d/$NAME
|
|
53 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
|
|
54 echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
|
55 exit 1
|
|
56 ;;
|
|
57 esac
|
|
58
|
|
59 exit 0
|