Author: Clint Byrum <clint@ubuntu.com>
Description: Uses --retry to wait up to 5 seconds for the killed process to die.
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/memcached/+bug/795673
Bug: http://code.google.com/p/memcached/issues/detail?id=250
Forwarded: yes, http://code.google.com/p/memcached/issues/detail?id=250
Last-Update: 2017-03-12

Index: memcached/scripts/memcached-init
===================================================================
--- memcached.orig/scripts/memcached-init
+++ memcached/scripts/memcached-init
@@ -81,7 +81,7 @@ case "$1" in
         ;;
     stop)
         echo -n "Stopping $DESC: "
-        start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
+        start-stop-daemon --stop --quiet --oknodo --retry 5 --pidfile $PIDFILE --exec $DAEMON
         echo "$NAME."
         rm -f $PIDFILE
         ;;
@@ -104,7 +104,7 @@ case "$1" in
     #   just the same as "restart".
     #
         echo -n "Restarting $DESC: "
-        start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
+        start-stop-daemon --stop --quiet --oknodo --retry 5 --pidfile $PIDFILE
         rm -f $PIDFILE
         sleep 1
         start-stop-daemon --start --quiet --exec "$DAEMONBOOTSTRAP" -- /etc/${NAME}.conf $PIDFILE
