Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 139 by superamazingdude: start-memcached script does not properly
daemonize
http://code.google.com/p/memcached/issues/detail?id=139
What steps will reproduce the problem?
1. start memcached using Ubuntu/Debian init script:
cl...@ubuntu:~$ sudo service memcached start
Starting memcached: memcached.
cl...@ubuntu:~$
2. Check process TTY:
cl...@ubuntu:~$ ps `pidof memcached`
PID TTY STAT TIME COMMAND
17651 pts/0 Sl 0:00 /usr/bin/memcached -m 64 -p 11211 -u nobody -l
127.0.0.1
3. Repeat without using init script, substituting -d, and notice that there
is no TTY.
cl...@ubuntu:~$ sudo /etc/init.d/memcached stop
Stopping memcached: memcached.
cl...@ubuntu:~$ /usr/bin/memcached -m 64 -p 11211 -u nobody -l 127.0.0.1 -d
cl...@ubuntu:~$ ps `pidof memcached`
PID TTY STAT TIME COMMAND
17672 ? Ssl 0:00 /usr/bin/memcached -m 64 -p 11211 -u nobody -l
127.0.0.1 -d
What is the expected output? What do you see instead?
I would expect a service to drop its TTY's if starting as a daemon.
What version of the product are you using? On what operating system?
Originally reported on memcached 1.2.8, but this is confirmed on v1.4.5
Please provide any additional information below.
This was reported against Ubuntu 9.10 in this bug report:
https://bugs.launchpad.net/ubuntu/+source/memcached/+bug/491685
This patch fixes the problem by employing the same technique the cpan
module Proc::Daemon
uses.
Attachments:
memcached-1.4.5-fix-start-memcached.patch 619 bytes