[Bug 491685] Re: memcached doesn't correctly daemonize

Mathias Gug mathiaz at ubuntu.com
Thu Jun 10 19:49:40 BST 2010


** Also affects: memcached via
   http://code.google.com/p/memcached/issues/detail?id=139
   Importance: Unknown
       Status: Unknown

-- 
memcached doesn't correctly daemonize
https://bugs.launchpad.net/bugs/491685
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is a direct subscriber.

Status in distributed memory object caching system: Unknown
Status in “memcached” package in Ubuntu: In Progress

Bug description:
Binary package hint: memcached

Ubuntu 9.10
memcached 1.2.8-1

it appears that launching memcached through the init.d scripts will cause it to daemonize in a way where it's still attached to the tty of the launching terminal/process. For instance, 'ps aux' shows:

nobody   16026  0.0  0.1  55976  2364 pts/0    Sl+  00:47   0:00 /usr/bin/memcached -m 128 -p 11211 -u nobody

where if I launch the command like so:

root at chllab-dev1:/home/rbd# su nobody --
$ /usr/bin/memcached -d -m 128 -p 11211 -u nobody

I see:

nobody    4970  0.0  0.0 113816   884 ?        Ssl  20:24   0:00 /usr/bin/memcached -d -m 128 -p 11211 -u nobody

Notice the command is not associated with a particular tty (good). This problem will not affect most people, but affects me because I have an application that will start up memcached when it starts up, and shut it down right before it's done shutting down. When my application receives a SIGINT, memcached gets the SIGINT as well and dies suddenly, where my app still needs it for the shutdown routine to complete.

The fix would be to have memcached's perl wrapper pass the -d flag along to the daemon...right now it appears that it ignores this, even if I uncomment it in the /etc/memcached.conf file





More information about the Ubuntu-sponsors mailing list