svn commit: r254440 - head/usr.sbin/rwhod
Hiroki Sato
hrs at FreeBSD.org
Mon Aug 19 19:45:05 UTC 2013
Mario Oshogbo <oshogbo at FreeBSD.org> wrote
in <521267C2.60001 at FreeBSD.org>:
os> Thank you for your commit and sorry for not repair this problem earlier.
os>
os> > @@ -274,6 +274,15 @@ main(int argc, char *argv[])
os> > exit(1);
os> > if (!quiet_mode) {
os> > pid_child_receiver = pdfork(&fdp, 0);
os> > + if (pid_child_receiver == -1) {
os> > + if (errno != ENOSYS) {
os> > + syslog(LOG_ERR, "pdfork: %m");
os> > + exit(1);
os> > + } else {
os> > + pid_child_receiver = fork();
os> > + fdp = -1;
os> > + }
os> > + }
os>
os> We can't do it this way. pdfork() is used there to prevent killing only
os> one process. If we use fork() and we kill parent process the second
os> process (child process) will become a zombie process. I suggest to
os> revert this change. The changes that Pawel commit (r254486 (thx
os> jilles!!!) and r254480) should resolve all problems.
When the parent process is killed, the child process will be an child
process of init, not a zombie, and init calls waitpid() when it
terminates (by SIGTERM, for example). I agree that this should be
improved, but I do not think removing fallback to fork(2) is a good
idea if PROCDESC is still a kernel option. Reverting will not solve
the problem that it does not work with a kernel without PROCDESC.
-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20130820/d9a4178e/attachment.sig>
More information about the svn-src-head
mailing list