Re:A simple Unix daemon in Python
by river_styx on Thursday July 31, 2008 @10:23AM
(#262982)
Can someone explain why he forks the process twice? The url in the comment doesn't work.
[ Parent
| on HN ]
"Under SVR4, some people recommend calling fork again at this point and having the parent terminate. The second child continues as the daemon. This guarantees that the daemon is not a session leader, which prevents it from acquiring a controlling terminal under the SVR4 rules. [...]"
(That's from p417 in my first edition copy of Stevens. The page number and/or the text may be different in the second edition.)