Re: sdnotify-wrapper docs clarification
Brett Neumeier writes: > On Fri, Feb 1, 2019 at 8:30 AM Profpatsch wrote: > >> > -f: do not doublefork. Use if the daemon waits for children it does >> > not know it has (for instance, superservers do this). When in doubt, >> > do not use that option, or you may have a zombie hanging around. >> Is the “that” here referring to the `-f` option or the daemon? >> In the first case, “do not use >this< option” is less ambiguous. >> > Hello Profpatsch! > > Double-forking is a common idiom for daemon processes, as described for > example here: > > https://stackoverflow.com/questions/881388 > > … Thanks all for the explanations! -- Written with Emacs (mu4e) on NixOS. Q: Why is this email five sentences or less? A: http://five.sentenc.es/ May take up to five days to read your message. If it’s urgent, call me.
Re: sdnotify-wrapper docs clarification
On Fri, Feb 01, 2019 at 03:30:27PM +0100, Profpatsch wrote: > > -f: do not doublefork. Use if the daemon waits for children it does > > not know it has (for instance, superservers do this). When in doubt, > > do not use that option, or you may have a zombie hanging around. > > > when in doubt, do not use that option > > Is the “that” here referring to the `-f` option or the daemon? > In the first case, “do not use >this< option” is less ambiguous. I'm sure it makes more sense in the original French. The way sdnotify-wrapper works is it: forks (or double-forks) a notifyer child, then execs into the program you are launching. Therefor the notification helper can be a child process of the actual service. Since programs that exit stick around in the process table until something acknowledges them, unless the service wait()s on things it doesn't know about you'll ens up with a defunct process if you use -f. > > (This is out of my own ignorance and probably clear to somebody > that is more into the subject matter) > > > Profpatsch > > -- > Written with Emacs (mu4e) on NixOS. > Q: Why is this email five sentences or less? > A: http://five.sentenc.es/ > May take up to five days to read your message. If it’s urgent, call me. -- Colin Booth
Re: sdnotify-wrapper docs clarification
On Fri, Feb 1, 2019 at 8:30 AM Profpatsch wrote: > > -f: do not doublefork. Use if the daemon waits for children it does > > not know it has (for instance, superservers do this). When in doubt, > > do not use that option, or you may have a zombie hanging around. > Is the “that” here referring to the `-f` option or the daemon? > In the first case, “do not use >this< option” is less ambiguous. > Hello Profpatsch! Double-forking is a common idiom for daemon processes, as described for example here: https://stackoverflow.com/questions/881388 The main purpose of double-forking is to ensure that the long-running daemon process is re-parented onto whatever `init` process is running as PID 1. The process running as PID 1 has the responsibility of calling wait on all of its child processes, even the ones that it did not fork directly, so that their slot in the process table can be cleaned up; many programs only call wait on the child processes that they know about. So what this text is saying is, if you happen to know that the process that is launching the daemon *does* call wait for child processes it does not know about, then you can skip the double-fork operation. But if you are not sure that it does that, you should omit the `-f` option and retain the default double-fork behavior. I agree that "...this option" is less ambiguous than "...that option". -- Brett Neumeier (bneume...@gmail.com)
sdnotify-wrapper docs clarification
> -f: do not doublefork. Use if the daemon waits for children it does > not know it has (for instance, superservers do this). When in doubt, > do not use that option, or you may have a zombie hanging around. > when in doubt, do not use that option Is the “that” here referring to the `-f` option or the daemon? In the first case, “do not use >this< option” is less ambiguous. (This is out of my own ignorance and probably clear to somebody that is more into the subject matter) Profpatsch -- Written with Emacs (mu4e) on NixOS. Q: Why is this email five sentences or less? A: http://five.sentenc.es/ May take up to five days to read your message. If it’s urgent, call me.