The daemonize/pty issue

From: Clint Byrum <>
Date: Thu, 21 Apr 2011 10:15:34 -0700

Hi everybody. I just joined so apologies for not replying to the thread.

Scott Kitterman asked me to take a look at the recently discussed issues
around daemonizing and letting go of the controlling terminal.

I've been able to reproduce it 100% of the time now with this command
going from Ubuntu 11.04 beta2 to a VM running Ubuntu 11.04 beta2:

ssh -tt ubuntu_at_1.2.3.4 sudo /usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/ -p inet:8891_at_localhost

I did have to make sure I had an ssh key and NOPASSWD: ALL on the box for
my user so that it would login/exit fast. This reinforces the possibility
of a race condition.

The child process always dies sometime after that, either before the
pidfile is created, or it cleans up the pidfile.

I've tried moving the call to 'setsid()' before the calls to dup2 to
move stdio to /dev/null. So far that has been unsuccessful, but I'm
trying some other things as well.

Stay tuned, I think we can actually get this fixed for 11.04's release
(crosses fingers).
Received on Thu Apr 21 2011 - 17:15:42 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:20:17 PST