Vincent Danjean wrote: > Michael Biebl a écrit : >> Vincent Danjean wrote: >>> dhcdbd installs the file /etc/dhcp3/dhclient-exit-hooks.d/dhcdbd that >>> is sourced by dhclient when dhcp event occurs. >>> The problem is that this file uses 'exit 0' in some cases (exactly when >>> "(( ( dhc_dbus & 31 ) == 31 ))" is true). Is this case, >>> /sbin/dhclient-script exits immediately and does not process the other >>> scripts in /etc/dhcp3/dhclient-exit-hooks.d >>> >>> So please : >>> * remove this 'exit 0' in the script >>> * or strongly document why all dhcp scripts named after dhcdbd in >>> alphabetic order will not run in some cases (and which cases exactly). >>> >>> As I see no reason to forbid a 'smtp' script but not a 'asmtp' script, I >>> thing you really need to remove the 'exit 0' >> I think 'exit_with_hooks 0' should be used. Should also work in your case. > > I do not really understand what you suggest. Is it to replace the > 'exit 0' by 'exit_with_hooks 0' in > etc/dhcp3/dhclient-exit-hooks.d/dhcdbd ? > > If I correctly read the code, dhclient executes /sbin/dhclient-script. > At the end of this script, there is a call to 'exit_with_hooks 0' > In this function, dhclient-script sources one after the other all the > files in /etc/dhcp3/dhclient-exit-hooks.d/ > The problem is that /etc/dhcp3/dhclient-exit-hooks.d/dhcdbd calls > 'exit 0' so /sbin/dhclient-script exits immediately without sourcing > the other scripts in /etc/dhcp3/dhclient-exit-hooks.d/ > I do not understand why this 'exit 0' is needed. It is not documented > and makes the dhcp script system behave very strangely. Some scripts are > executed, and others are not. > And I do not think that calling 'exit_with_hooks 0' instead of > 'exit 0' will work: there will be infinite recursion (but I do not test > it, yet) >
After a more thorough look, I came to the conclusion that the script /etc/dhcp3/dhclient-exit-hooks.d/dhcdbd in it's current form does not make any sense at all and should be removed for now. The code in /etc/dhcp3/dhclient-exit-hooks.d/dhcdbd should be executed at the beginning of /sbin/dhclient-script. The return value of the dbus call to dhcdbd is stored in the variable dhc_dbus and depending on this return value, dhclient-script should modify certain ressources (e.g. /etc/resolv.conf, lease time etc). or not. /sbin/dhclient-script (dhcp3-client package) would need to be patched for this, which it currently isn't. I hope, Riccardo can commit on this issue, why this file /etc/dhcp3/dhclient-exit-hooks.d/dhcdbd was added at all. Cheers, Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
signature.asc
Description: OpenPGP digital signature

