From: Shawn Routhier Date: Wed, 2 Jul 2014 15:56:21 +0000 (-0700) Subject: [v4_2] Add define to disable gentle shutodwn by default X-Git-Tag: v4_2_7b1~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=12c8a2db365864c7cd52da9d25e899a6eeee8347;p=thirdparty%2Fdhcp.git [v4_2] Add define to disable gentle shutodwn by default Add a define to disable the gentle shutdown feature by default. The feature has some effects (recover-wait in failvoer pairs) and release in clients that are always desired. We plan to revisit this in order to make it easier to use but with the define it can be enabled if necessary. --- diff --git a/RELNOTES b/RELNOTES index 6d87138fd..a37e47094 100644 --- a/RELNOTES +++ b/RELNOTES @@ -130,11 +130,15 @@ by Eric Young (eay@cryptsoft.com). - Add code to properly dereference a pointer in the dhclient code on an error condition. - [ISC-Bugs #36194 + [ISC-Bugs #36194] - Add code to help clean up soft leases. [ISC-Bugs #36304] +- Disable the gentle shutdown functionality until we can determine + the best way to present it to remove or reduce the side effects. + [ISC-Bugs #36066] + Changes since 4.2.6rc1 - None diff --git a/client/dhclient.c b/client/dhclient.c index 8d803d9ec..25d9747a4 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -694,9 +694,12 @@ main(int argc, char **argv) { dmalloc_outstanding = 0; #endif +#if defined(ENABLE_GENTLE_SHUTDOWN) + /* no signal handlers until we deal with the side effects */ /* install signal handlers */ signal(SIGINT, dhcp_signal_handler); /* control-c */ signal(SIGTERM, dhcp_signal_handler); /* kill */ +#endif /* If we're not supposed to wait before getting the address, don't. */ diff --git a/includes/site.h b/includes/site.h index fac1fd079..946ddb0e5 100644 --- a/includes/site.h +++ b/includes/site.h @@ -293,4 +293,12 @@ prefix. */ #define DHCLIENT_DEFAULT_PREFIX_LEN 64 +/* Enable the gentle shutdown signal handling. Currently this + means that on SIGINT or SIGTERM a client will release its + address and a server in a failover pair will go through + partner down. Both of which can be undesireable in some + situations. We plan to revisit this feature and may + make non-backwards compatible changes including the + removal of this define. Use at your own risk. */ +/* #define ENABLE_GENTLE_SHUTDOWN */ diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c index 78d5bcd31..927e40489 100644 --- a/relay/dhcrelay.c +++ b/relay/dhcrelay.c @@ -572,9 +572,12 @@ main(int argc, char **argv) { dhcpv6_packet_handler = do_packet6; #endif +#if defined(ENABLE_GENTLE_SHUTDOWN) + /* no signal handlers until we deal with the side effects */ /* install signal handlers */ signal(SIGINT, dhcp_signal_handler); /* control-c */ signal(SIGTERM, dhcp_signal_handler); /* kill */ +#endif /* Start dispatching packets and timeouts... */ dispatch(); diff --git a/server/dhcpd.c b/server/dhcpd.c index 46a668089..884d15736 100644 --- a/server/dhcpd.c +++ b/server/dhcpd.c @@ -857,9 +857,12 @@ main(int argc, char **argv) { omapi_set_int_value ((omapi_object_t *)dhcp_control_object, (omapi_object_t *)0, "state", server_running); +#if defined(ENABLE_GENTLE_SHUTDOWN) + /* no signal handlers until we deal with the side effects */ /* install signal handlers */ signal(SIGINT, dhcp_signal_handler); /* control-c */ signal(SIGTERM, dhcp_signal_handler); /* kill */ +#endif /* * Receive packets and dispatch them...