From: Shawn Routhier Date: Wed, 2 Jul 2014 15:49:19 +0000 (-0700) Subject: [master] Add define to disable gentle shutodwn by default X-Git-Tag: v4_3_1b1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9326fd0f4561db5496f18523da15612213bd1b4;p=thirdparty%2Fdhcp.git [master] 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 f9bb65bd5..f8c62a4a5 100644 --- a/RELNOTES +++ b/RELNOTES @@ -172,11 +172,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.3.0rc1 - None diff --git a/client/dhclient.c b/client/dhclient.c index 12c42b792..5ef59cd4b 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -714,9 +714,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 6ba5a8a76..d87b309e9 100644 --- a/includes/site.h +++ b/includes/site.h @@ -295,6 +295,15 @@ 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 */ + /* Include definitions for various options. In general these should be left as is, but if you have already defined one of these and prefer your definition you can comment the diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c index 115fbd457..80ebc3957 100644 --- a/relay/dhcrelay.c +++ b/relay/dhcrelay.c @@ -591,9 +591,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 1f2d774f7..24d638e7d 100644 --- a/server/dhcpd.c +++ b/server/dhcpd.c @@ -787,9 +787,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 /* Log that we are about to start working */ log_info("Server starting service.");