diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2017-07-12 03:27:48 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-17 13:49:02 +0100 |
commit | 7d3e734481e5d400d03ffd0a12669913fd264c5f (patch) | |
tree | 6fe315945c22c57df3ce1e0c393ad7490b812284 /meta/recipes-connectivity | |
parent | 9ee6a0a6599d081767b63382a576e67aed12cf4d (diff) | |
download | openembedded-core-7d3e734481e5d400d03ffd0a12669913fd264c5f.tar.gz openembedded-core-7d3e734481e5d400d03ffd0a12669913fd264c5f.tar.bz2 openembedded-core-7d3e734481e5d400d03ffd0a12669913fd264c5f.zip |
dhcp: fix shutdown not work by SIGTERM while bind9 enable threads
In https://source.isc.org/git/bind9.git, since the following
commit applied:
...
commit b99bfa184bc9375421b5df915eea7dfac6a68a99
Author: Evan Hunt <each@isc.org>
Date: Wed Apr 10 13:49:57 2013 -0700
[master] unify internal and export libraries
3550. [func] Unified the internal and export versions of the
BIND libraries, allowing external clients to use
the same libraries as BIND. [RT #33131]
...
(git show b99bfa184bc9375421b5df915eea7dfac6a68a99 -- ./lib/isc/unix/app.c)
In this commit, if bind9 enable threads(ISC_PLATFORM_USETHREADS),
it blocks signal SIGHUP, SIGINT and SIGTERM in isc__app_ctxstart.
Which caused dhclient/dhcpd could not be stopped by SIGTERM.
It caused systemd's reboot hung which send SIGTERM by default.
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-connectivity')
-rw-r--r-- | meta/recipes-connectivity/dhcp/dhcp/Moved-the-call-to-isc_app_ctxstart-to-not-get-signal.patch | 81 | ||||
-rw-r--r-- | meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb | 1 |
2 files changed, 82 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/dhcp/dhcp/Moved-the-call-to-isc_app_ctxstart-to-not-get-signal.patch b/meta/recipes-connectivity/dhcp/dhcp/Moved-the-call-to-isc_app_ctxstart-to-not-get-signal.patch new file mode 100644 index 0000000000..9b43f96a85 --- /dev/null +++ b/meta/recipes-connectivity/dhcp/dhcp/Moved-the-call-to-isc_app_ctxstart-to-not-get-signal.patch @@ -0,0 +1,81 @@ +From e8c30bac53f8baeb80f87b445f42259cc8984fb5 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Wed, 12 Jul 2017 03:05:13 -0400 +Subject: [PATCH] Moved the call to isc_app_ctxstart() to not get signal block + by all threads + +Signed-off-by: Francis Dupont <fdupont@isc.org> + +In https://source.isc.org/git/bind9.git, since the following +commit applied: +... +commit b99bfa184bc9375421b5df915eea7dfac6a68a99 +Author: Evan Hunt <each@isc.org> +Date: Wed Apr 10 13:49:57 2013 -0700 + + [master] unify internal and export libraries + + 3550. [func] Unified the internal and export versions of the + BIND libraries, allowing external clients to use + the same libraries as BIND. [RT #33131] +... +(git show b99bfa184bc9375421b5df915eea7dfac6a68a99 -- ./lib/isc/unix/app.c) + +In this commit, if bind9 enable threads(ISC_PLATFORM_USETHREADS), +it blocks signal SIGHUP, SIGINT and SIGTERM in isc__app_ctxstart. +Which caused dhclient/dhcpd could not be stopped by SIGTERM. + +It caused systemd's reboot hung which send SIGTERM by default. + +Upstream-Status: Backport [https://source.isc.org/git/dhcp.git] +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + omapip/isclib.c | 25 +++++++++++++++---------- + 1 file changed, 15 insertions(+), 10 deletions(-) + +diff --git a/omapip/isclib.c b/omapip/isclib.c +index 13f0d3e..4af04b6 100644 +--- a/omapip/isclib.c ++++ b/omapip/isclib.c +@@ -185,16 +185,6 @@ dhcp_context_create(int flags, + if (result != ISC_R_SUCCESS) + goto cleanup; + +- result = isc_app_ctxstart(dhcp_gbl_ctx.actx); +- if (result != ISC_R_SUCCESS) +- return (result); +- dhcp_gbl_ctx.actx_started = ISC_TRUE; +- +- /* Not all OSs support suppressing SIGPIPE through socket +- * options, so set the sigal action to be ignore. This allows +- * broken connections to fail gracefully with EPIPE on writes */ +- handle_signal(SIGPIPE, SIG_IGN); +- + result = isc_taskmgr_createinctx(dhcp_gbl_ctx.mctx, + dhcp_gbl_ctx.actx, + 1, 0, +@@ -217,6 +207,21 @@ dhcp_context_create(int flags, + result = isc_task_create(dhcp_gbl_ctx.taskmgr, 0, &dhcp_gbl_ctx.task); + if (result != ISC_R_SUCCESS) + goto cleanup; ++ ++ result = isc_app_ctxstart(dhcp_gbl_ctx.actx); ++ if (result != ISC_R_SUCCESS) ++ return (result); ++ dhcp_gbl_ctx.actx_started = ISC_TRUE; ++ ++ /* Not all OSs support suppressing SIGPIPE through socket ++ * options, so set the sigal action to be ignore. This allows ++ * broken connections to fail gracefully with EPIPE on writes */ ++ handle_signal(SIGPIPE, SIG_IGN); ++ ++ /* Reset handlers installed by isc_app_ctxstart() ++ * to default for control-c and kill */ ++ handle_signal(SIGINT, SIG_DFL); ++ handle_signal(SIGTERM, SIG_DFL); + } + + #if defined (NSUPDATE) +-- +2.8.1 + diff --git a/meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb b/meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb index 0a73eccc4b..964d05dde0 100644 --- a/meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb +++ b/meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb @@ -10,6 +10,7 @@ SRC_URI += "file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \ file://tweak-to-support-external-bind.patch \ file://remove-dhclient-script-bash-dependency.patch \ file://build-shared-libs.patch \ + file://Moved-the-call-to-isc_app_ctxstart-to-not-get-signal.patch \ " SRC_URI[md5sum] = "2b5e5b2fa31c2e27e487039d86f83d3f" |