summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/dhcp
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2017-07-12 03:27:48 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-17 14:01:39 +0100
commita731d879a79d9abf47b7a3f541f9c1b011f732e1 (patch)
treeae7912f3a8bff93d597b802e2f60b12d57450bb7 /meta/recipes-connectivity/dhcp
parent39f74e11fda240c39135c5f12ed24cc8f0364c72 (diff)
downloadpoky-a731d879a79d9abf47b7a3f541f9c1b011f732e1.tar.gz
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. (From OE-Core rev: 7d3e734481e5d400d03ffd0a12669913fd264c5f) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/dhcp')
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp/Moved-the-call-to-isc_app_ctxstart-to-not-get-signal.patch81
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb1
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 @@
1From e8c30bac53f8baeb80f87b445f42259cc8984fb5 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Wed, 12 Jul 2017 03:05:13 -0400
4Subject: [PATCH] Moved the call to isc_app_ctxstart() to not get signal block
5 by all threads
6
7Signed-off-by: Francis Dupont <fdupont@isc.org>
8
9In https://source.isc.org/git/bind9.git, since the following
10commit applied:
11...
12commit b99bfa184bc9375421b5df915eea7dfac6a68a99
13Author: Evan Hunt <each@isc.org>
14Date: Wed Apr 10 13:49:57 2013 -0700
15
16 [master] unify internal and export libraries
17
18 3550. [func] Unified the internal and export versions of the
19 BIND libraries, allowing external clients to use
20 the same libraries as BIND. [RT #33131]
21...
22(git show b99bfa184bc9375421b5df915eea7dfac6a68a99 -- ./lib/isc/unix/app.c)
23
24In this commit, if bind9 enable threads(ISC_PLATFORM_USETHREADS),
25it blocks signal SIGHUP, SIGINT and SIGTERM in isc__app_ctxstart.
26Which caused dhclient/dhcpd could not be stopped by SIGTERM.
27
28It caused systemd's reboot hung which send SIGTERM by default.
29
30Upstream-Status: Backport [https://source.isc.org/git/dhcp.git]
31Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
32---
33 omapip/isclib.c | 25 +++++++++++++++----------
34 1 file changed, 15 insertions(+), 10 deletions(-)
35
36diff --git a/omapip/isclib.c b/omapip/isclib.c
37index 13f0d3e..4af04b6 100644
38--- a/omapip/isclib.c
39+++ b/omapip/isclib.c
40@@ -185,16 +185,6 @@ dhcp_context_create(int flags,
41 if (result != ISC_R_SUCCESS)
42 goto cleanup;
43
44- result = isc_app_ctxstart(dhcp_gbl_ctx.actx);
45- if (result != ISC_R_SUCCESS)
46- return (result);
47- dhcp_gbl_ctx.actx_started = ISC_TRUE;
48-
49- /* Not all OSs support suppressing SIGPIPE through socket
50- * options, so set the sigal action to be ignore. This allows
51- * broken connections to fail gracefully with EPIPE on writes */
52- handle_signal(SIGPIPE, SIG_IGN);
53-
54 result = isc_taskmgr_createinctx(dhcp_gbl_ctx.mctx,
55 dhcp_gbl_ctx.actx,
56 1, 0,
57@@ -217,6 +207,21 @@ dhcp_context_create(int flags,
58 result = isc_task_create(dhcp_gbl_ctx.taskmgr, 0, &dhcp_gbl_ctx.task);
59 if (result != ISC_R_SUCCESS)
60 goto cleanup;
61+
62+ result = isc_app_ctxstart(dhcp_gbl_ctx.actx);
63+ if (result != ISC_R_SUCCESS)
64+ return (result);
65+ dhcp_gbl_ctx.actx_started = ISC_TRUE;
66+
67+ /* Not all OSs support suppressing SIGPIPE through socket
68+ * options, so set the sigal action to be ignore. This allows
69+ * broken connections to fail gracefully with EPIPE on writes */
70+ handle_signal(SIGPIPE, SIG_IGN);
71+
72+ /* Reset handlers installed by isc_app_ctxstart()
73+ * to default for control-c and kill */
74+ handle_signal(SIGINT, SIG_DFL);
75+ handle_signal(SIGTERM, SIG_DFL);
76 }
77
78 #if defined (NSUPDATE)
79--
802.8.1
81
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 \
10 file://tweak-to-support-external-bind.patch \ 10 file://tweak-to-support-external-bind.patch \
11 file://remove-dhclient-script-bash-dependency.patch \ 11 file://remove-dhclient-script-bash-dependency.patch \
12 file://build-shared-libs.patch \ 12 file://build-shared-libs.patch \
13 file://Moved-the-call-to-isc_app_ctxstart-to-not-get-signal.patch \
13 " 14 "
14 15
15SRC_URI[md5sum] = "2b5e5b2fa31c2e27e487039d86f83d3f" 16SRC_URI[md5sum] = "2b5e5b2fa31c2e27e487039d86f83d3f"