[Swan-dev] use vfork/exec

Andrew Cagney andrew.cagney at gmail.com
Fri Oct 16 21:48:09 UTC 2015


On 16 October 2015 at 16:56, Paul Wouters <paul at nohats.ca> wrote:
>
> The debug printing can easilly be moved.
>
> The sleep was there to ensure the parent had continued, and when the
> addconn fork is calling the parent on the socket in /var/run, there
> is something listening. If that is actually needed, we could add it
> as an option to addconn to pause for one second there.

My guess (incorrect) was that it was trying to keep log messages
somewhat in sync.   Ewww.

Thanks for the background.  Yea, technically, it should either use
synchronization (pipes for instance); but, sigh, I guess a while loop
with a sleep to make it really clear what it is waiting for would also
work.

BTW, if there's code lurking that is turning a process into a daemon
(fork/fork/exec) is one technique; then that should be changed to just
call daemon().

Andrew


More information about the Swan-dev mailing list