:: Re: [DNG] Reaping orphan processes.
Page principale
Supprimer ce message
Répondre à ce message
Auteur: Rainer Weikusat
Date:  
À: dng
Sujet: Re: [DNG] Reaping orphan processes.
Antoine <tacredips@???> writes:
> On Monday, 6 March at 16:58, Hendrik Boom wrote:
>>On Mon, Mar 06, 2023 at 07:15:23PM +0100, aitor wrote:
>>>
>>> One of the drawbacks of sysvinit is that it cannot run daemons in the foreground.
>>> As opposed to it, daemons supervised by runit must necessarily run in the foreground,
>>> but often they have been designed to run in the background with sysvinit in mind.
>>
>>What is the difference between 'foreground' and 'background' in this context?
>
> Simple version: background would be when the parent process can run in
> parallel with the child process. Foreground means the parent process
> is paused while the child is running.


This is wrong. In this context, 'foreground' means the daemon program
runs as child of the process which started it (which can therefore also
wait for it to get its termination status and possibly, restart
it). 'Background' means the daemon program (or something else) forked
once more and the original process exited. The daemon program now runs
in an orphaned process which is unrelated to the one which originally
started it.

That's a bit oversimplified (eg, a background process will usually also
change its session) but generally correct.