1
Index: memcached-1.4.5/scripts/memcached-init
2
===================================================================
3
--- memcached-1.4.5.orig/scripts/memcached-init
4
+++ memcached-1.4.5/scripts/memcached-init
8
-# skeleton example file to build /etc/init.d/ scripts.
9
-# This file should be used to construct scripts for /etc/init.d.
11
-# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
12
-# Modified for Debian
13
-# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
15
-# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
1
--- a/scripts/memcached-init
2
+++ b/scripts/memcached-init
18
6
-# Provides: memcached
19
7
-# Required-Start: $syslog
20
8
-# Required-Stop: $syslog
9
-# Should-Start: $local_fs
10
-# Should-Stop: $local_fs
21
11
-# Default-Start: 2 3 4 5
22
12
-# Default-Stop: 0 1 6
23
-# Short-Description: Start memcached daemon at boot time
24
-# Description: Enable memcached server
25
+# Provides: memcached
26
+# Required-Start: $remote_fs $syslog
27
+# Required-Stop: $remote_fs $syslog
28
+# Should-Start: $local_fs
29
+# Should-Stop: $local_fs
30
+# Default-Start: 2 3 4 5
31
+# Default-Stop: 0 1 6
32
+# Short-Description: Start memcached daemon
33
+# Description: Start up memcached, a high-performance memory caching daemon
13
-# Short-Description: memcached - Memory caching daemon
14
-# Description: memcached - Memory caching daemon
16
+# Provides: memcached
17
+# Required-Start: $remote_fs $syslog
18
+# Required-Stop: $remote_fs $syslog
19
+# Should-Start: $local_fs
20
+# Should-Stop: $local_fs
21
+# Default-Start: 2 3 4 5
22
+# Default-Stop: 0 1 6
23
+# Short-Description: Start memcached daemon
24
+# Description: Start up memcached, a high-performance memory caching daemon
37
@@ -32,38 +24,50 @@ test -x $DAEMONBOOTSTRAP || exit 0
44
35
+ENABLE_MEMCACHED=no
45
36
+test -r /etc/default/memcached && . /etc/default/memcached
39
FILES=(/etc/memcached_*.conf)
40
# check for alternative config schema
41
if [ -r "${FILES[0]}" ]; then
43
PIDFILE="/var/run/${NAME}.pid"
49
47
- echo -n "Starting $DESC: "
50
- start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP
48
- start-stop-daemon --start --quiet --exec "$DAEMONBOOTSTRAP" -- /etc/${NAME}.conf $PIDFILE
80
+ echo -n "Starting $DESC: "
81
+ if [ $ENABLE_MEMCACHED = yes ]; then
82
+ start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP
85
+ echo "$NAME disabled in /etc/default/memcached."
78
+ echo -n "Starting $DESC: "
79
+ if [ $ENABLE_MEMCACHED = yes ]; then
80
+ start-stop-daemon --start --quiet --exec "$DAEMONBOOTSTRAP" -- /etc/${NAME}.conf $PIDFILE
83
+ echo "$NAME disabled in /etc/default/memcached."
89
+ echo -n "Stopping $DESC: "
90
+ start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
87
+ echo -n "Stopping $DESC: "
88
+ start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
95
93
+ restart|force-reload)
97
+ # If the "reload" option is implemented, move the "force-reload"
98
+ # option to the "reload" entry above. If not, "force-reload" is
99
+ # just the same as "restart".
101
+ echo -n "Restarting $DESC: "
102
+ start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
105
+ start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP
95
+ # If the "reload" option is implemented, move the "force-reload"
96
+ # option to the "reload" entry above. If not, "force-reload" is
97
+ # just the same as "restart".
99
+ echo -n "Restarting $DESC: "
100
+ start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
102
+ if [ $ENABLE_MEMCACHED = yes ]; then
104
+ start-stop-daemon --start --quiet --exec "$DAEMONBOOTSTRAP" -- /etc/${NAME}.conf $PIDFILE
107
+ echo "$NAME disabled in /etc/default/memcached."
109
+ status_of_proc $DAEMON $NAME
111
+ status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
112
114
+ N=/etc/init.d/$NAME
113
115
+ echo "Usage: $N {start|stop|restart|force-reload|status}" >&2