apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Klaus Keppler <klaus.kepp...@informatik.stud.uni-erlangen.de>
Subject Re: apr_terminate with multiple processes?
Date Tue, 27 Jan 2004 12:12:44 GMT
Hmm... it's really too early for my brain... ;-)

Daemonizing is best done with apr_proc_detach, and that one calls
just "fork()" (not apr_proc_fork). By the way, for what reason takes
apr_proc_detach no apr_pool_t argument, but apr_proc_fork does?

Additionaly, fork() creates a whole copy of the process, thus
it shouldn't be wrong to clean up (with apr_terminate) when
the start process terminates, isn't it?


Klaus Keppler schrieb:
> Hello everybody,
> a little question on apr_terminate: the docs say that an application 
> should call that function when leaving this world - best way to
> do this is using "atexit".
> But what if I fork some childs  using apr_proc_fork? As I see in
> threadproc/unix/proc.s there are no subpools created before
> calling fork. When I want to daemonize my process, I usually
> fork() one time and let the (old) main prozess exit.
> If I am right, that main process should *not* call apr_terminate,
> when one or more of its childs continue working...?!
>    Klaus

View raw message