~upstart-devel/upstart/upstart-jobs

« back to all changes in this revision

Viewing changes to vivid/etc/init.d/memcachedb

  • Committer: Dimitri John Ledkov
  • Date: 2014-11-19 12:58:41 UTC
  • Revision ID: dimitri.j.ledkov@intel.com-20141119125841-98dr37roy8dvcv3b
auto update

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
### BEGIN INIT INFO
 
3
# Provides:             memcachedb
 
4
# Required-Start:       $local_fs $remote_fs $syslog
 
5
# Required-Stop:        $local_fs $remote_fs $syslog
 
6
# Default-Start:        2 3 4 5
 
7
# Default-Stop:         0 1 6
 
8
# Short-Description:    memcachedb - Persistent cache daemon
 
9
# Description:          memcachedb - Persistent cache daemon
 
10
### END INIT INFO
 
11
 
 
12
 
 
13
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 
14
DAEMON=/usr/bin/memcachedb
 
15
DAEMONBOOTSTRAP=/usr/share/memcachedb/start-memcachedb
 
16
NAME=memcachedb
 
17
DESC=memcachedb
 
18
PIDFILE=/var/run/$NAME.pid
 
19
 
 
20
test -x $DAEMON || exit 0
 
21
test -x $DAEMONBOOTSTRAP || exit 0
 
22
 
 
23
. /lib/lsb/init-functions
 
24
 
 
25
set -e
 
26
 
 
27
case "$1" in
 
28
  start)
 
29
        echo -n "Starting $DESC: "
 
30
        start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP
 
31
        echo "$NAME."
 
32
        ;;
 
33
  stop)
 
34
        echo -n "Stopping $DESC: "
 
35
        start-stop-daemon --stop --retry 10 --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON 
 
36
        echo "$NAME."
 
37
        rm -f $PIDFILE
 
38
        ;;
 
39
 
 
40
  restart|force-reload)
 
41
        #
 
42
        #       If the "reload" option is implemented, move the "force-reload"
 
43
        #       option to the "reload" entry above. If not, "force-reload" is
 
44
        #       just the same as "restart".
 
45
        #
 
46
        echo -n "Restarting $DESC: "
 
47
        start-stop-daemon --stop --retry 10 --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON 
 
48
        rm -f $PIDFILE
 
49
        start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP
 
50
        echo "$NAME."
 
51
        ;;
 
52
  status)
 
53
        status_of_proc /usr/bin/$NAME $NAME
 
54
        ;;
 
55
  *)
 
56
        N=/etc/init.d/$NAME
 
57
        # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
 
58
        echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
 
59
        exit 1
 
60
        ;;
 
61
esac
 
62
 
 
63
exit 0