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

Index: memcached/scripts/memcached-init
===================================================================
--- memcached.orig/scripts/memcached-init	2012-02-09 15:07:20.834152608 -0800
+++ memcached/scripts/memcached-init	2012-02-09 15:22:44.424307457 -0800
@@ -92,7 +92,7 @@
        ;;
   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,10 +104,9 @@
        #       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
        if [ $ENABLE_MEMCACHED = yes ]; then
-       		sleep 1
        		start-stop-daemon --start --quiet --exec "$DAEMONBOOTSTRAP" -- /etc/${NAME}.conf $PIDFILE
        		echo "$NAME."
        else
