[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#713967: apache2-bin: daemon doesn't close all fds on fork - which causes postinst with debconf to hang



Hey Stefan,
> I don't think this can be fixed in apache itself. There is not even a
> portable way to close all FDs. On Linux you can look in /proc/$PID/fd,
> but I doubt that works on kfreebsd or hurd.
>
> Your postinst scripts should close the debconf FD explicitly. This
> could be done by calling debconf's STOP command before doing the
> restarting. See the debconf-devel(7) man page. Or maybe, if the code
> is generated by dh_apache2, that could close FD 3 before restarting
> apache2.

Thanks for pointing me to db_stop, never tried that before.

Though in terms of closing fds when forking a daemon I'd like to point
at the following tutorial:
http://www.fifi.org/doc/debconf-doc/tutorial.html#AEN198

[quote]
Your postinst uses debconf and starts a daemon that doesn't close all
inherited file descriptors (all such daemons are buggy, really). This
makes debconf hang, because the debconf frontend waits for the daemon
to close the fd's before continuing. Note that if you use confmodule,
the program probably needs to close fd's 0, 1, 2, and 3.
[/quote]

This should be fixed in Apache2 IMHO, but I will implement db_stop as well.

Cheers
Markus

--
Markus Frosch
markus@lazyfrosch.de
http://www.lazyfrosch.de


Reply to: