Re: svn commit: r254440 - head/usr.sbin/rwhod
> 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 > Yes, but Pawel add PROCDESC to GENERIC in commit r254480. signature.asc Description: OpenPGP digital signature
Re: svn commit: r254440 - head/usr.sbin/rwhod
Mario Oshogbo wrote in <521267c2.60...@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 pgp89FUBvHbvy.pgp Description: PGP signature
Re: svn commit: r254440 - head/usr.sbin/rwhod
Thank you for your commit and sorry for not repair this problem earlier. > @@ -274,6 +274,15 @@ main(int argc, char *argv[]) > exit(1); > if (!quiet_mode) { > pid_child_receiver = pdfork(&fdp, 0); > + if (pid_child_receiver == -1) { > + if (errno != ENOSYS) { > + syslog(LOG_ERR, "pdfork: %m"); > + exit(1); > + } else { > + pid_child_receiver = fork(); > + fdp = -1; > + } > + } We can't do it this way. pdfork() is used there to prevent killing only one process. If we use fork() and we kill parent process the second process (child process) will become a zombie process. I suggest to revert this change. The changes that Pawel commit (r254486 (thx jilles!!!) and r254480) should resolve all problems. Cheers, oshogbo signature.asc Description: OpenPGP digital signature
svn commit: r254440 - head/usr.sbin/rwhod
Author: hrs Date: Sat Aug 17 07:12:52 2013 New Revision: 254440 URL: http://svnweb.freebsd.org/changeset/base/254440 Log: Unbreak rwhod(8): - It did not work with GENERIC kernel after r250603 because options PROCDESC was required for pdfork(2). It now just uses fork(2) instead when this syscall is not available. - Fix verify(). This function was broken in r250602 because the outermost "()" was removed from the condition !(isalnum() || ispunct()). It prevented hostnames including "-", for example. Modified: head/usr.sbin/rwhod/rwhod.c Modified: head/usr.sbin/rwhod/rwhod.c == --- head/usr.sbin/rwhod/rwhod.c Sat Aug 17 07:10:01 2013(r254439) +++ head/usr.sbin/rwhod/rwhod.c Sat Aug 17 07:12:52 2013(r254440) @@ -274,6 +274,15 @@ main(int argc, char *argv[]) exit(1); if (!quiet_mode) { pid_child_receiver = pdfork(&fdp, 0); + if (pid_child_receiver == -1) { + if (errno != ENOSYS) { + syslog(LOG_ERR, "pdfork: %m"); + exit(1); + } else { + pid_child_receiver = fork(); + fdp = -1; + } + } if (pid_child_receiver == 0) { receiver_process(); } else if (pid_child_receiver > 0) { @@ -328,7 +337,7 @@ verify(char *name, int maxlen) size = 0; while (*name != '\0' && size < maxlen - 1) { - if (!isascii(*name) || !isalnum(*name) || ispunct(*name)) + if (!isascii(*name) || !(isalnum(*name) || ispunct(*name))) return (0); name++; size++; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"