Re: Daemonize() should re-parent its caller

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sun, 27 Jan 2002 19:48:47 +0000 (GMT)


> But a more elegant and economical solution is to have the daemonize()
> routine automatically re-parent its caller to be a child of init
> (assuming the caller's parent isn't init already). At the same time,
> the caller's exit_signal should be set to SIGCHLD. This would
> definitely solve the problem, and it is unlikely to introduce any
> incompatibilities with existing code.

We have a seperate reparent_to_init() function in 2.4 to do this. That was
kept seperately mostly to avoid introducing mysterious changes of behaviour
in daemonize() calls during 2.4

For 2.5 I agree, the reparent_to_init belongs in daemonize()
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/