memcached doesn't correctly daemonize
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Memcached Mirror |
Unknown
|
Unknown
|
|||
memcached (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
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@chllab-
$ /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
Changed in memcached (Ubuntu): | |
assignee: | nobody → Clint Byrum (clint-fewbar) |
status: | New → In Progress |
Changed in memcached (Ubuntu): | |
importance: | Undecided → Wishlist |
importance: | Wishlist → Medium |
importance: | Medium → Low |
assignee: | nobody → Mathias Gug (mathiaz) |
status: | Confirmed → In Progress |
tags: | added: patch |
tags: | added: patch-forwarded-upstream |
the start-memcached script is at fault, I reported the following upstream:
http:// code.google. com/p/memcached /issues/ detail? id=139