[pkg-dhcp-devel] Bug#849100: Is initializing exit_status to 0 really correct?

Arne Nordmark nordmark at mech.kth.se
Wed May 10 15:17:42 UTC 2017


Note that the man page for dhclient-script says:

The exit status of dhclient-script will be passed to dhclient-exit-hooks 
in the  exit_sta‐
tus  shell variable, and will always be zero if the script succeeded at 
the task for which
it was invoked.   The rest of the environment as described previously 
for  dhclient-enter-
hooks  is  also  present.   The /etc/dhcp/dhclient-exit-hooks and 
/etc/dhcp/dhclient-exit-
hooks.d/* scripts can modify the value  of  exit_status  to  change the  
exit  status  of
dhclient-script.

This seems to be in conflict with the implemented fix of setting 
exit_status=0 before calling the hooks. If the man page is correct, each 
script in turn should have the chance to update exit_status, and the 
value after calling the final script is the one to use for return.

Arne



More information about the pkg-dhcp-devel mailing list