Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distccd --no-detach outlives its parent process #129

Open
GoogleCodeExporter opened this issue May 26, 2015 · 2 comments
Open

distccd --no-detach outlives its parent process #129

GoogleCodeExporter opened this issue May 26, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

trunk r780 on Debian sid

Originally reported at <http://bugs.debian.org/709169>.


NoDetachDaemon_Case leaves the daemon process running.  Maybe specific to 
Debians sh (dash 0.5.7).  I shall patch this in trunk if someone confirms this 
effects other systems.


$ PATH="`pwd`:/usr/local/bin:/bin:/usr/bin" PYTHONPATH="`pwd`/test" python2.7 
Python 2.7.3 (default, Mar  5 2013, 01:19:40) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import testdistcc
>>> obj = testdistcc.NoDetachDaemon_Case()
>>> obj.setup()
>>> print obj.pid # the process reaped by killDaemon
3905
>>> print open(obj.daemon_pidfile, "r").read()
3906

>>> �

[1]+  Stopped                 PATH="`pwd`:/usr/local/bin:/bin:/usr/bin" 
PYTHONPATH="`pwd`/test" python2.7
$ ps xf | grep distccd | grep -v grep
 3905 pts/1    T      0:00  |   \_ /bin/sh -c distccd «ARGS»
 3906 pts/1    SN     0:00  |       \_ distccd «ARGS»
 3907 pts/1    SN     0:00  |           \_ distccd «ARGS»
 3908 pts/1    SN     0:00  |           \_ distccd «ARGS»
 3909 pts/1    SN     0:00  |           \_ distccd «ARGS»
$ fg
PATH="`pwd`:/usr/local/bin:/bin:/usr/bin" PYTHONPATH="`pwd`/test" python2.7

>>> obj.killDaemon()
>>> 
$ ps xf | grep distccd | grep -v grep
 3906 pts/1    SN     0:00 distccd «ARGS»
 3907 pts/1    SN     0:00  \_ distccd «ARGS»
 3908 pts/1    SN     0:00  \_ distccd «ARGS»
 3909 pts/1    SN     0:00  \_ distccd «ARGS»
$ 


The log file confirms “not detaching”.

You can see that ‘killDaemon’ reaps the shell process and the daemon 
process survives.  To me that seems strange and perhaps a bug; is there some 
reason why the daemon should outlive the shell when ‘--no-detach’ is used?

Original issue reported on code.google.com by [email protected] on 25 May 2013 at 4:51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant