Jdesk / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

start-memcached needs to call setsid() #129

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Start a memcached with the included start-memcached perl script from a
real tty.
2.  Log out, note the processes stay there.
3.  From ssh, or another tty, kill the tty that you called start-memcached
from.
4.  Note that your memcached processes are dead and gone.

What is the expected output? What do you see instead?
Expected to see processes still there, there were none instead.

What version of the product are you using? On what operating system?
1.2.2-1+lenny1build0 on Ubuntu Jaunty (9.04)

Please provide any additional information below.
Here's the diff to a patch that fixes the issue.  It makes sure posix is
present before calling setsid()

--- a/start-memcached   2010-04-06 22:17:52.000000000 +0000
+++ b/start-memcached   2010-04-06 22:26:50.000000000 +0000
@@ -106,6 +106,8 @@
 if($pid == 0)
 {
        reopen_logfile($fd_reopened);
+       eval "use POSIX qw(setsid)";
+       setsid() unless $@;
        exec "$memcached $params";
        exit(0);

Original issue reported on code.google.com by techadv...@gmail.com on 6 Apr 2010 at 10:37

GoogleCodeExporter commented 9 years ago
this has been fixed in later versions of memcached 1.2.2 is ancient history.

Original comment by lind...@inuus.com on 7 Apr 2010 at 12:20

GoogleCodeExporter commented 9 years ago

Original comment by dsalli...@gmail.com on 7 Apr 2010 at 12:40

GoogleCodeExporter commented 9 years ago
Forgive me if I'm missing something obvious, but I don't see any setsid() 
references
here: http://github.com/memcached/memcached/blob/master/scripts/start-memcached 
- as
a matter of fact, that's pretty much the exact script I have in my 1.2.2 deb.

Was it fixed in the memcached daemon?

Original comment by techadv...@gmail.com on 7 Apr 2010 at 1:31