~yolanda.robla/ubuntu/trusty/memcached/add_distribution

« back to all changes in this revision

Viewing changes to debian/patches/01_init_script_additions.patch

  • Committer: Bazaar Package Importer
  • Author(s): David Martínez Moreno
  • Date: 2010-05-12 11:41:22 UTC
  • mfrom: (1.1.7 upstream) (3.3.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100512114122-e2dphwiezevuny1t
Tags: 1.4.5-1
* New upstream release.  Main changes since 1.4.2 are:
  New features:
  - Support for SASL authentication.
  - New script damemtop - a memcached top.
  - Slab optimizations.
  - New stats, for reclaimed memory and SASL events.
  Bugs fixed:
  - Malicious input can crash server (CVE-2010-1152).  Closes: #579913.
  - Fixed several problems with slab handling and growth.
  - Provide better error reporting.
  - Fix get stats accounting.
  - Fixed backwards compatibility with delete 0.
  - Documentation fixes.
  - Various build fixes, among others, fixed FTBFS with gcc-4.5 (closes:
    #565033).
* Refreshed and renamed 01_init_script_compliant_with_LSB.patch.
* Fixed lintian warnings by adding $remote_fs to init.d script.
* Removed non-existent document (doc/memory_management.txt).
* debian/control: Bumped Standards-Version to 3.8.4 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
@@ -1,22 +1,14 @@
 
6
 #! /bin/sh
 
7
-#
 
8
-# skeleton  example file to build /etc/init.d/ scripts.
 
9
-#       This file should be used to construct scripts for /etc/init.d.
 
10
-#
 
11
-#       Written by Miquel van Smoorenburg <miquels@cistron.nl>.
 
12
-#       Modified for Debian
 
13
-#       by Ian Murdock <imurdock@gnu.ai.mit.edu>.
 
14
-#
 
15
-# Version:  @(#)skeleton  1.9  26-Feb-2001  miquels@cistron.nl
 
16
-#
 
17
 ### BEGIN INIT INFO
 
18
-# Provides:          memcached
 
19
-# Required-Start:    $syslog
 
20
-# Required-Stop:     $syslog
 
21
-# Default-Start:     2 3 4 5
 
22
-# 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
 
34
 ### END INIT INFO
 
35
 
 
36
 
 
37
@@ -32,38 +24,50 @@ test -x $DAEMONBOOTSTRAP || exit 0
 
38
 
 
39
 set -e
 
40
 
 
41
+. /lib/lsb/init-functions
 
42
+
 
43
+# Edit /etc/default/memcached to change this.
 
44
+ENABLE_MEMCACHED=no
 
45
+test -r /etc/default/memcached && . /etc/default/memcached
 
46
+
 
47
 case "$1" in
 
48
-    start)
 
49
-        echo -n "Starting $DESC: "
 
50
-        start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP
 
51
-        echo "$NAME."
 
52
-        ;;
 
53
-    stop)
 
54
-        echo -n "Stopping $DESC: "
 
55
-        start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
 
56
-        echo "$NAME."
 
57
-        rm -f $PIDFILE
 
58
-        ;;
 
59
-
 
60
-    restart|force-reload)
 
61
-    #
 
62
-    #   If the "reload" option is implemented, move the "force-reload"
 
63
-    #   option to the "reload" entry above. If not, "force-reload" is
 
64
-    #   just the same as "restart".
 
65
-    #
 
66
-        echo -n "Restarting $DESC: "
 
67
-        start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
 
68
-        rm -f $PIDFILE
 
69
-        sleep 1
 
70
-        start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP
 
71
-        echo "$NAME."
 
72
-        ;;
 
73
-    *)
 
74
-        N=/etc/init.d/$NAME
 
75
-    # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
 
76
-        echo "Usage: $N {start|stop|restart|force-reload}" >&2
 
77
-        exit 1
 
78
-        ;;
 
79
+  start)
 
80
+       echo -n "Starting $DESC: "
 
81
+  if [ $ENABLE_MEMCACHED = yes ]; then
 
82
+       start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP
 
83
+       echo "$NAME."
 
84
+       else
 
85
+               echo "$NAME disabled in /etc/default/memcached."
 
86
+       fi
 
87
+       ;;
 
88
+  stop)
 
89
+       echo -n "Stopping $DESC: "
 
90
+       start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
 
91
+       echo "$NAME."
 
92
+       rm -f $PIDFILE
 
93
+       ;;
 
94
+
 
95
+  restart|force-reload)
 
96
+       #
 
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".
 
100
+       #
 
101
+       echo -n "Restarting $DESC: "
 
102
+       start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
 
103
+       rm -f $PIDFILE
 
104
+       sleep 1
 
105
+       start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP
 
106
+       echo "$NAME."
 
107
+       ;;
 
108
+  status)
 
109
+       status_of_proc $DAEMON $NAME
 
110
+       ;;
 
111
+  *)
 
112
+       N=/etc/init.d/$NAME
 
113
+       echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
 
114
+       exit 1
 
115
+       ;;
 
116
 esac
 
117
 
 
118
 exit 0