Re: The daemonize/pty issue

From: Murray S. Kucherawy <msk_at_blackops.org>
Date: Thu, 21 Apr 2011 10:54:11 -0700 (PDT)

On Thu, 21 Apr 2011, Clint Byrum wrote:
> Hi everybody. I just joined so apologies for not replying to the thread.

Seems like you hadn't subscribed yet because we had to approve this
manually.

> 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/opendkim.pid -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).

Is there some reason use of nohup(1) has been disqualified? I believe
this scenario is exactly why that tool was created.

-MSK
Received on Thu Apr 21 2011 - 17:54:27 PST

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