im having some really weird and annoying issue with memcached. im running ubuntu server 10.04lts on a linode instance. i am using fabric with a django project and part of the fabric script allows the restart of the memcached process. today i noticed fabric outputting an error saying the following

Restarting memcached: start-stop-daemon: warning: failed to kill 8175: No such process

i then immediatley ssh'd to the box to start having a poke around to see if it was just a one off or some kind of issue with fabric. so i run the command directly on the box

Restarting memcached: start-stop-daemon: warning: failed to kill 8186: No such process

same deal different process id. i then attempted to telnet to memcached which worked fine. the process id was now 8123. a quick ps aux | grep memcached command showed that the process was running under this pid.

www-data  7259  0.0  0.1  45972   772 ?        Ssl  16:38   0:00 memcached -d -u www-data -p 11211 -m 64
www-data  8123  0.0  2.4  57220 12260 ?        Ssl  17:02   0:00 memcached -d -u www-data -p 11211 -m 64

so i thought maybe something happend during installing memcached via apt that i just didnt notice before so i removed memcached and re installed without any errors. i then got memcached running with the following options

sudo memcached -d -u www-data -p 11211 -m 64

the really strange thing is if i stop memcached and start it again, i can run /etc/init.d/memcached restart without any errors once, after that the same warning regarding the pid not being found happens all over again.

Im at my wits end with this now, Please help :/ !!


Forceable kill the processes running,

sudo kill -9 {process_id}

Ensure nothing is running, if /var/run/memcached.pid exists rm that too :p

Then try sudo /etc/init.d/memcachd start

Check the process id in /var/run/memcached.pid matches the one when you ps aux | grep memcache. If they do then you should be fine running sudo /etc/init.d/memcachd {start/stop/restart}

An upstart script would be cool too :)


  • cheers @krak3n things obviously got muddled up somewhere along the lines ;) – Mike Waites Feb 9 '12 at 10:29

Since you're using Lucid, have you considered setting up memcached in Upstart?

Something like this should work:

$ cat /etc/init/memcached.conf
# memcached - in-memory cache
description "memcached"

start on (local-filesystems and started networking)
stop on runlevel [!2345]


pre-start script
  test -x /usr/bin/memcached || { stop; exit 0; }
end script

exec /usr/bin/memcached -d -u www-data -p 11211 -m 64 

In this case, Upstart will handle keeping memcached alive.

  • hey, yeah i had considered this however id like to know what the cause of the problem is. I have never had this problem before and have used this set up countless times. do you have any suggestions on trying to debug this issue? – Mike Waites Feb 9 '12 at 9:32

This was actually reported as a bug here:


I just fixed it in the dev release of Ubuntu (currently precise). The fix is pretty tiny and should be back-portable to 10.04 as well, as time permits.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.