On Mon, 2008-12-08 at 15:54 +0100, Bernd Petrovitsch wrote:
> On Mon, 2008-12-08 at 07:57 +0100, Sven-Ola Tuecke wrote: 
> > Markus,
> > 
> > while writing that mail I discovered another: doing "kill -HUP olsrd" does not 
> > work as expected (should restart by calling olsrd_reconfigure()). This may be 
> > fixed...
> 
> AFAICS this is broken since ages: all the open files and socket remain
> open after fork()+exec() (which is not the most elegant way to implement
> a restart feature).
> So either one closes all fd's > 2 there or all of the fd's get the
> close-on-exec flag set - which is e.g. hard on fd opened by e.g.
> syslog().
> 
> Please give me a few minutes ....

Please review/test/... http://gredler.at/hg/olsrd/rev/d9c2226cb81a

We simply close all filedescriptors > "stderr". And - which we diodn't
do before - if we are started with "-nofork", we avoid to fork() into
the background.

What else should be done before the (self-)execv()?
I don't know if it makes sense to remove the routes from the kernel or
intentionally leave them.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services



