[patch] fix automatic reload of configuration files

Timo Hoenig thoenig at suse.de
Wed Nov 2 06:36:41 PST 2005


Hi,

I've recently investigated why the automatic reload of configuration
files does not work as expected.


Currently, reloading configuration files does only work when running
dbus-daemon with --nodaemon.  If we are running as daemon we're hitting
a dnotify bug once we fork the process.

We're initializing the dnotify fds before calling fork().  Once the
child process forked it does still have the fds (and they still show up
in /proc/`pidof dbus-daemon`/fd/) but we're not getting SIGIO as changes
are made to the configuration files.

The attached patch moves the initialization of the dnotify fds to
process_config_postinit().  This is safe for all current code paths and
solves the dnotify disfunction.  If we're running dbus-daemon as daemon
the fds for dnotify are now being initialized after fork() for the child
process.

Patch: dbus-dnotify_watchdirs-01.diff
bus.c |   16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)


The current configure.in check for dnotify probes 'x$target_os' for
being 'xlinux-gnu'.  I've changed the check to match for 'xlinux', too.
Additionally I have adapted the configure option's style to match with
the others.

Patch: dbus-dnotify_configure-01.diff
configure.in |   22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)


Please review.

Thanks,

   Timo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-dnotify_watchdirs-01.diff
Type: text/x-patch
Size: 1252 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20051102/fb9493ea/dbus-dnotify_watchdirs-01.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-dnotify_configure-01.diff
Type: text/x-patch
Size: 2197 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20051102/fb9493ea/dbus-dnotify_configure-01.bin


More information about the dbus mailing list