diff options
Diffstat (limited to 'meta/recipes-connectivity/kea')
8 files changed, 282 insertions, 149 deletions
diff --git a/meta/recipes-connectivity/kea/files/0001-keactrl.in-create-var-lib-kea-and-var-run-kea-folder.patch b/meta/recipes-connectivity/kea/files/0001-keactrl.in-create-var-lib-kea-and-var-run-kea-folder.patch deleted file mode 100644 index ab3fd83946..0000000000 --- a/meta/recipes-connectivity/kea/files/0001-keactrl.in-create-var-lib-kea-and-var-run-kea-folder.patch +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | From 639dc25cdabc9d1846000a542c8cc19158b69994 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
3 | Date: Fri, 18 Sep 2020 08:18:08 +0000 | ||
4 | Subject: [PATCH] keactrl.in: create /var/lib/kea and /var/run/kea folder | ||
5 | |||
6 | Create /var/lib/kea and /var/run/kea folder to fix below error: | ||
7 | # keactrl start | ||
8 | INFO/keactrl: Starting /usr/sbin/kea-dhcp4 -c /etc/kea/kea-dhcp4.conf | ||
9 | INFO/keactrl: Starting /usr/sbin/kea-dhcp6 -c /etc/kea/kea-dhcp6.conf | ||
10 | INFO/keactrl: Starting /usr/sbin/kea-ctrl-agent -c /etc/kea/kea-ctrl-agent.conf | ||
11 | Unable to use interprocess sync lockfile (No such file or directory): /var/run/kea/logger_lockfile | ||
12 | Service failed: Launch failed: Unable to open PID file '/var/run/kea/kea-ctrl-agent.kea-ctrl-agent.pid' for write | ||
13 | [snip] | ||
14 | ERROR [kea-dhcp4.dhcp4/615.140641792751488] DHCP4_CONFIG_LOAD_FAIL configuration error using file: /etc/kea/kea-dhcp4.conf, reason: Unable to open database: unable to open '/var/lib/kea/kea-leases4.csv' | ||
15 | [snip] | ||
16 | |||
17 | Upstream-Status: Inappropriate [config specific] | ||
18 | |||
19 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
20 | --- | ||
21 | src/bin/keactrl/keactrl.in | 2 ++ | ||
22 | 1 file changed, 2 insertions(+) | ||
23 | |||
24 | diff --git a/src/bin/keactrl/keactrl.in b/src/bin/keactrl/keactrl.in | ||
25 | index 12b2b3f..47cf6f9 100644 | ||
26 | --- a/src/bin/keactrl/keactrl.in | ||
27 | +++ b/src/bin/keactrl/keactrl.in | ||
28 | @@ -482,6 +482,8 @@ case ${command} in | ||
29 | # The variables (dhcp4_srv, dhcp6_serv, dhcp_ddns_srv etc) are set in the | ||
30 | # keactrl.conf file that shellcheck is unable to read. | ||
31 | # shellcheck disable=SC2154 | ||
32 | + [ -d @LOCALSTATEDIR@/run/kea ] || mkdir -p @LOCALSTATEDIR@/run/kea | ||
33 | + [ -d @LOCALSTATEDIR@/lib/kea ] || mkdir -p @LOCALSTATEDIR@/lib/kea | ||
34 | run_conditional "dhcp4" "start_server ${dhcp4_srv} -c ${kea_dhcp4_config_file} ${args}" 1 | ||
35 | run_conditional "dhcp6" "start_server ${dhcp6_srv} -c ${kea_dhcp6_config_file} ${args}" 1 | ||
36 | # shellcheck disable=SC2154 | ||
37 | -- | ||
38 | 2.26.2 | ||
39 | |||
diff --git a/meta/recipes-connectivity/kea/files/0001-make-kea-environment-available-to-lfc.patch b/meta/recipes-connectivity/kea/files/0001-make-kea-environment-available-to-lfc.patch new file mode 100644 index 0000000000..15c09d4c41 --- /dev/null +++ b/meta/recipes-connectivity/kea/files/0001-make-kea-environment-available-to-lfc.patch | |||
@@ -0,0 +1,96 @@ | |||
1 | From 72d7e6c0b6b5af4fea2e4db9ed33757984ccdc5b Mon Sep 17 00:00:00 2001 | ||
2 | From: Razvan Becheriu <razvan@isc.org> | ||
3 | Date: Fri, 14 Jun 2024 17:09:50 +0300 | ||
4 | Subject: [PATCH] make kea environment available to lfc | ||
5 | |||
6 | Upstream-Status: Backport | ||
7 | [https://gitlab.isc.org/isc-projects/kea/-/commit/f477e8ebcc8b8e1f1adaad4d55031084c0ff6f40] | ||
8 | |||
9 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
10 | --- | ||
11 | configure.ac | 2 ++ | ||
12 | src/lib/dhcpsrv/memfile_lease_mgr.cc | 3 ++- | ||
13 | .../tests/memfile_lease_mgr_unittest.cc | 26 +++++++++++++++++++ | ||
14 | src/lib/dhcpsrv/tests/test_kea_lfc_env.sh.in | 6 +++++ | ||
15 | 4 files changed, 36 insertions(+), 1 deletion(-) | ||
16 | create mode 100644 src/lib/dhcpsrv/tests/test_kea_lfc_env.sh.in | ||
17 | |||
18 | diff --git a/configure.ac b/configure.ac | ||
19 | index c00edb5..7b572b0 100644 | ||
20 | --- a/configure.ac | ||
21 | +++ b/configure.ac | ||
22 | @@ -1629,6 +1629,8 @@ AC_CONFIG_FILES([src/lib/dhcp_ddns/tests/Makefile]) | ||
23 | AC_CONFIG_FILES([src/lib/dhcpsrv/Makefile]) | ||
24 | AC_CONFIG_FILES([src/lib/dhcpsrv/tests/Makefile]) | ||
25 | AC_CONFIG_FILES([src/lib/dhcpsrv/tests/test_libraries.h]) | ||
26 | +AC_CONFIG_FILES([src/lib/dhcpsrv/tests/test_kea_lfc_env.sh], | ||
27 | + [chmod +x src/lib/dhcpsrv/tests/test_kea_lfc_env.sh]) | ||
28 | AC_CONFIG_FILES([src/lib/dhcpsrv/testutils/Makefile]) | ||
29 | AC_CONFIG_FILES([src/lib/dns/Makefile]) | ||
30 | AC_CONFIG_FILES([src/lib/dns/tests/Makefile]) | ||
31 | diff --git a/src/lib/dhcpsrv/memfile_lease_mgr.cc b/src/lib/dhcpsrv/memfile_lease_mgr.cc | ||
32 | index db4f5d5..0ecf3e7 100644 | ||
33 | --- a/src/lib/dhcpsrv/memfile_lease_mgr.cc | ||
34 | +++ b/src/lib/dhcpsrv/memfile_lease_mgr.cc | ||
35 | @@ -209,7 +209,8 @@ LFCSetup::setup(const uint32_t lfc_interval, | ||
36 | args.push_back("ignored-path"); | ||
37 | |||
38 | // Create the process (do not start it yet). | ||
39 | - process_.reset(new ProcessSpawn(ProcessSpawn::ASYNC, executable, args)); | ||
40 | + process_.reset(new ProcessSpawn(ProcessSpawn::ASYNC, executable, args, | ||
41 | + ProcessEnvVars(), true)); | ||
42 | |||
43 | // If we've been told to run it once now, invoke the callback directly. | ||
44 | if (run_once_now) { | ||
45 | diff --git a/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc | ||
46 | index 034f1f5..9edf637 100644 | ||
47 | --- a/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc | ||
48 | +++ b/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc | ||
49 | @@ -534,6 +534,32 @@ TEST_F(MemfileLeaseMgrTest, lfcTimer) { | ||
50 | EXPECT_EQ(2, lease_mgr->getLFCCount()); | ||
51 | } | ||
52 | |||
53 | +/// @brief Check that the kea environment is accesible to the Lease | ||
54 | +/// File Cleanup process. | ||
55 | +TEST_F(MemfileLeaseMgrTest, lfcEnv) { | ||
56 | + DatabaseConnection::ParameterMap pmap; | ||
57 | + pmap["type"] = "memfile"; | ||
58 | + pmap["universe"] = "4"; | ||
59 | + pmap["name"] = getLeaseFilePath("leasefile4_0.csv"); | ||
60 | + pmap["lfc-interval"] = "1"; | ||
61 | + | ||
62 | + std::ostringstream s; | ||
63 | + s << DHCP_DATA_DIR << "/test_kea_lfc_env.sh"; | ||
64 | + setenv("KEA_LFC_EXECUTABLE", s.str().c_str(), 1); | ||
65 | + | ||
66 | + boost::scoped_ptr<NakedMemfileLeaseMgr> lease_mgr(new NakedMemfileLeaseMgr(pmap)); | ||
67 | + | ||
68 | + // Try to run the lease file cleanup. | ||
69 | + ASSERT_NO_THROW(lease_mgr->lfcCallback()); | ||
70 | + | ||
71 | + // Wait for the LFC process to complete. | ||
72 | + ASSERT_TRUE(waitForProcess(*lease_mgr, 1)); | ||
73 | + | ||
74 | + // And make sure it has returned an exit status of 0. | ||
75 | + EXPECT_EQ(0, lease_mgr->getLFCExitStatus()) | ||
76 | + << "environment not available to LFC"; | ||
77 | +} | ||
78 | + | ||
79 | /// @brief This test checks if the LFC timer is disabled (doesn't trigger) | ||
80 | /// cleanups when the lfc-interval is set to 0. | ||
81 | TEST_F(MemfileLeaseMgrTest, lfcTimerDisabled) { | ||
82 | diff --git a/src/lib/dhcpsrv/tests/test_kea_lfc_env.sh.in b/src/lib/dhcpsrv/tests/test_kea_lfc_env.sh.in | ||
83 | new file mode 100644 | ||
84 | index 0000000..3eb71d5 | ||
85 | --- /dev/null | ||
86 | +++ b/src/lib/dhcpsrv/tests/test_kea_lfc_env.sh.in | ||
87 | @@ -0,0 +1,6 @@ | ||
88 | +#!/bin/sh | ||
89 | + | ||
90 | +if [ $(env | grep -c KEA_LFC_EXECUTABLE) != 0 ]; then | ||
91 | + exit 0 | ||
92 | +fi | ||
93 | +exit 1 | ||
94 | -- | ||
95 | 2.25.1 | ||
96 | |||
diff --git a/meta/recipes-connectivity/kea/files/0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch b/meta/recipes-connectivity/kea/files/0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch new file mode 100644 index 0000000000..94fbd12737 --- /dev/null +++ b/meta/recipes-connectivity/kea/files/0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 841924e1fe8db2bff3eab8d37634ef08f86c00ec Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
3 | Date: Tue, 10 Nov 2020 15:57:03 +0000 | ||
4 | Subject: [PATCH] src/lib/log/logger_unittest_support.cc: do not write build | ||
5 | path into binary | ||
6 | |||
7 | This breaks reproducibility and is needed only in unit testing. | ||
8 | |||
9 | Upstream-Status: Inappropriate [oe-core specific] | ||
10 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | ||
11 | |||
12 | --- | ||
13 | src/lib/log/logger_unittest_support.cc | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/src/lib/log/logger_unittest_support.cc b/src/lib/log/logger_unittest_support.cc | ||
17 | index fc01c6e..f46d17e 100644 | ||
18 | --- a/src/lib/log/logger_unittest_support.cc | ||
19 | +++ b/src/lib/log/logger_unittest_support.cc | ||
20 | @@ -84,7 +84,7 @@ void initLogger(isc::log::Severity severity, int dbglevel) { | ||
21 | const char* localfile = getenv("KEA_LOGGER_LOCALMSG"); | ||
22 | |||
23 | // Set a directory for creating lockfiles when running tests | ||
24 | - setenv("KEA_LOCKFILE_DIR", TOP_BUILDDIR, 0); | ||
25 | + //setenv("KEA_LOCKFILE_DIR", TOP_BUILDDIR, 0); | ||
26 | |||
27 | // Initialize logging | ||
28 | initLogger(root, severity, dbglevel, localfile); | ||
diff --git a/meta/recipes-connectivity/kea/files/fix-multilib-conflict.patch b/meta/recipes-connectivity/kea/files/fix-multilib-conflict.patch index 733adf5536..763639327a 100644 --- a/meta/recipes-connectivity/kea/files/fix-multilib-conflict.patch +++ b/meta/recipes-connectivity/kea/files/fix-multilib-conflict.patch | |||
@@ -1,25 +1,34 @@ | |||
1 | There are conflict of config files between kea and lib32-kea: | 1 | From 06ebd1b2ced426c420ed162980eca194f9f918ae Mon Sep 17 00:00:00 2001 |
2 | From: Kai Kang <kai.kang@windriver.com> | ||
3 | Date: Tue, 22 Sep 2020 15:02:33 +0800 | ||
4 | Subject: [PATCH] There are conflict of config files between kea and lib32-kea: | ||
2 | 5 | ||
3 | | Error: Transaction test error: | 6 | | Error: Transaction test error: |
4 | | file /etc/kea/kea-ctrl-agent.conf conflicts between attempted installs of | 7 | | file /etc/kea/kea-ctrl-agent.conf conflicts between attempted installs of |
5 | lib32-kea-1.7.10-r0.core2_32 and kea-1.7.10-r0.core2_64 | 8 | lib32-kea-1.7.10-r0.core2_32 and kea-1.7.10-r0.core2_64 |
6 | | file /etc/kea/kea-dhcp4.conf conflicts between attempted installs of | 9 | | file /etc/kea/kea-dhcp4.conf conflicts between attempted installs of |
7 | lib32-kea-1.7.10-r0.core2_32 and kea-1.7.10-r0.core2_64 | 10 | lib32-kea-1.7.10-r0.core2_32 and kea-1.7.10-r0.core2_64 |
11 | | file /etc/kea/kea-dhcp6.conf conflicts between attempted installs of | ||
12 | lib32-kea-2.6.1-r0.core2_32 and kea-2.6.1-r0.core2_64 | ||
8 | 13 | ||
9 | Because they are all commented out, replace the expanded libdir path with | 14 | Because they are all commented out, replace the expanded libdir path with |
10 | '$libdir' in the config files to avoid conflict. | 15 | '$libdir' in the config files to avoid conflict. |
11 | 16 | ||
17 | Upstream-Status: Submitted [https://gitlab.isc.org/isc-projects/kea/-/issues/2602] | ||
12 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | 18 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
19 | Signed-off-by: Lei Maohui <leimaohui@fujitsu.com> | ||
20 | |||
13 | --- | 21 | --- |
14 | src/bin/keactrl/kea-ctrl-agent.conf.pre | 3 ++- | 22 | src/bin/keactrl/kea-ctrl-agent.conf.pre | 3 ++- |
15 | src/bin/keactrl/kea-dhcp4.conf.pre | 6 ++++-- | 23 | src/bin/keactrl/kea-dhcp4.conf.pre | 4 ++-- |
16 | 2 files changed, 6 insertions(+), 3 deletions(-) | 24 | src/bin/keactrl/kea-dhcp6.conf.pre | 4 ++-- |
25 | 3 files changed, 6 insertions(+), 5 deletions(-) | ||
17 | 26 | ||
18 | diff --git a/src/bin/keactrl/kea-ctrl-agent.conf.pre b/src/bin/keactrl/kea-ctrl-agent.conf.pre | 27 | diff --git a/src/bin/keactrl/kea-ctrl-agent.conf.pre b/src/bin/keactrl/kea-ctrl-agent.conf.pre |
19 | index 211b7ff..d710ec7 100644 | 28 | index e6ae8b8..50a3092 100644 |
20 | --- a/src/bin/keactrl/kea-ctrl-agent.conf.pre | 29 | --- a/src/bin/keactrl/kea-ctrl-agent.conf.pre |
21 | +++ b/src/bin/keactrl/kea-ctrl-agent.conf.pre | 30 | +++ b/src/bin/keactrl/kea-ctrl-agent.conf.pre |
22 | @@ -45,7 +45,8 @@ | 31 | @@ -51,7 +51,8 @@ |
23 | // Agent will fail to start. | 32 | // Agent will fail to start. |
24 | "hooks-libraries": [ | 33 | "hooks-libraries": [ |
25 | // { | 34 | // { |
@@ -30,26 +39,46 @@ index 211b7ff..d710ec7 100644 | |||
30 | // "param1": "foo" | 39 | // "param1": "foo" |
31 | // } | 40 | // } |
32 | diff --git a/src/bin/keactrl/kea-dhcp4.conf.pre b/src/bin/keactrl/kea-dhcp4.conf.pre | 41 | diff --git a/src/bin/keactrl/kea-dhcp4.conf.pre b/src/bin/keactrl/kea-dhcp4.conf.pre |
33 | index 5f77a32..70ae3d9 100644 | 42 | index 6edb8a1..b2a7385 100644 |
34 | --- a/src/bin/keactrl/kea-dhcp4.conf.pre | 43 | --- a/src/bin/keactrl/kea-dhcp4.conf.pre |
35 | +++ b/src/bin/keactrl/kea-dhcp4.conf.pre | 44 | +++ b/src/bin/keactrl/kea-dhcp4.conf.pre |
36 | @@ -252,7 +252,8 @@ | 45 | @@ -255,7 +255,7 @@ |
37 | // // of all devices serviced by Kea, including their identifiers | 46 | // // of all devices serviced by Kea, including their identifiers |
38 | // // (like MAC address), their location in the network, times | 47 | // // (like MAC address), their location in the network, times |
39 | // // when they were active etc. | 48 | // // when they were active etc. |
40 | - // "library": "@libdir@/kea/hooks/libdhcp_legal_log.so" | 49 | - // "library": "@libdir@/kea/hooks/libdhcp_legal_log.so", |
41 | + // // Replace $libdir with real library path /usr/lib or /usr/lib64 | 50 | + // "library": "$libdir/kea/hooks/libdhcp_legal_log.so", |
42 | + // "library": "$libdir/kea/hooks/libdhcp_legal_log.so" | 51 | // "parameters": { |
43 | // "parameters": { | 52 | // "path": "/var/lib/kea", |
44 | // "path": "/var/lib/kea", | 53 | // "base-name": "kea-forensic4" |
45 | // "base-name": "kea-forensic4" | 54 | @@ -272,7 +272,7 @@ |
46 | @@ -269,7 +270,8 @@ | 55 | // // of specific options or perhaps even a combination of several |
47 | // // of specific options or perhaps even a combination of several | 56 | // // options and fields to uniquely identify a client. Those scenarios |
48 | // // options and fields to uniquely identify a client. Those scenarios | 57 | // // are addressed by the Flexible Identifiers hook application. |
49 | // // are addressed by the Flexible Identifiers hook application. | 58 | - // "library": "@libdir@/kea/hooks/libdhcp_flex_id.so", |
50 | - // "library": "@libdir@/kea/hooks/libdhcp_flex_id.so", | 59 | + // "library": "$libdir/kea/hooks/libdhcp_flex_id.so", |
51 | + // // Replace $libdir with real library path /usr/lib or /usr/lib64 | 60 | // "parameters": { |
52 | + // "library": "$libdir/kea/hooks/libdhcp_flex_id.so", | 61 | // "identifier-expression": "relay4[2].hex" |
53 | // "parameters": { | 62 | // } |
54 | // "identifier-expression": "substring(relay6[0].option[18],0,8)" | 63 | diff --git a/src/bin/keactrl/kea-dhcp6.conf.pre b/src/bin/keactrl/kea-dhcp6.conf.pre |
55 | // } | 64 | index 271021b..5b85854 100644 |
65 | --- a/src/bin/keactrl/kea-dhcp6.conf.pre | ||
66 | +++ b/src/bin/keactrl/kea-dhcp6.conf.pre | ||
67 | @@ -201,7 +201,7 @@ | ||
68 | // // of all devices serviced by Kea, including their identifiers | ||
69 | // // (like MAC address), their location in the network, times | ||
70 | // // when they were active etc. | ||
71 | - // "library": "@libdir@/kea/hooks/libdhcp_legal_log.so", | ||
72 | + // "library": "$libdir/kea/hooks/libdhcp_legal_log.so", | ||
73 | // "parameters": { | ||
74 | // "path": "/var/lib/kea", | ||
75 | // "base-name": "kea-forensic6" | ||
76 | @@ -218,7 +218,7 @@ | ||
77 | // // of specific options or perhaps even a combination of several | ||
78 | // // options and fields to uniquely identify a client. Those scenarios | ||
79 | // // are addressed by the Flexible Identifiers hook application. | ||
80 | - // "library": "@libdir@/kea/hooks/libdhcp_flex_id.so", | ||
81 | + // "library": "$libdir/kea/hooks/libdhcp_flex_id.so", | ||
82 | // "parameters": { | ||
83 | // "identifier-expression": "relay6[0].option[37].hex" | ||
84 | // } | ||
diff --git a/meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch b/meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch index eeeb89942b..2f5a217d3f 100644 --- a/meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch +++ b/meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch | |||
@@ -1,22 +1,35 @@ | |||
1 | Busybox does not support ps -p so use pgrep | 1 | From f5125725e4e2e250ccc78a17a8b77431100e7c15 Mon Sep 17 00:00:00 2001 |
2 | From: Armin kuster <akuster808@gmail.com> | ||
3 | Date: Wed, 14 Oct 2020 22:48:31 -0700 | ||
4 | Subject: [PATCH] Busybox does not support ps -p so use pgrep | ||
2 | 5 | ||
3 | Upstream-Status: Inappropriate [embedded specific] | 6 | Upstream-Status: Inappropriate [embedded specific] |
4 | Based on changes from Diego Sueiro <Diego.Sueiro@arm.com> | 7 | Based on changes from Diego Sueiro <Diego.Sueiro@arm.com> |
5 | 8 | ||
6 | Signed-off-by: Armin kuster <akuster808@gmail.com> | 9 | Signed-off-by: Armin kuster <akuster808@gmail.com> |
7 | 10 | ||
8 | Index: kea-1.7.10/src/bin/keactrl/keactrl.in | 11 | Refresh to apply on top of 2.6.1. |
9 | =================================================================== | 12 | |
10 | --- kea-1.7.10.orig/src/bin/keactrl/keactrl.in | 13 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
11 | +++ kea-1.7.10/src/bin/keactrl/keactrl.in | 14 | --- |
12 | @@ -137,8 +137,8 @@ check_running() { | 15 | src/bin/keactrl/keactrl.in | 4 ++-- |
16 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/src/bin/keactrl/keactrl.in b/src/bin/keactrl/keactrl.in | ||
19 | index cccfdac303..20ae2e6ec5 100644 | ||
20 | --- a/src/bin/keactrl/keactrl.in | ||
21 | +++ b/src/bin/keactrl/keactrl.in | ||
22 | @@ -146,8 +146,8 @@ check_running() { | ||
13 | # Get the PID from the PID file (if it exists) | 23 | # Get the PID from the PID file (if it exists) |
14 | get_pid_from_file "${proc_name}" | 24 | get_pid_from_file "${proc_name}" |
15 | if [ ${_pid} -gt 0 ]; then | 25 | if [ ${_pid} -gt 0 ]; then |
16 | - # Use ps to check if PID is alive | 26 | - # Use ps to check if PID is alive |
17 | - ps -p ${_pid} 1>/dev/null | 27 | - if ps -p ${_pid} 1>/dev/null; then |
18 | + # Use pgrep and grep to check if PID is alive | 28 | + # Use pgrep and grep to check if PID is alive |
19 | + pgrep -v 1 | grep ${_pid} 1>/dev/null | 29 | + if pgrep -v 1 | grep ${_pid} 1>/dev/null; then |
20 | retcode=$? | ||
21 | if [ $retcode -eq 0 ]; then | ||
22 | # No error, so PID IS ALIVE | 30 | # No error, so PID IS ALIVE |
31 | _running=1 | ||
32 | fi | ||
33 | -- | ||
34 | 2.39.2 | ||
35 | |||
diff --git a/meta/recipes-connectivity/kea/files/kea-dhcp-ddns.service b/meta/recipes-connectivity/kea/files/kea-dhcp-ddns.service index 91aa2eb14f..f6059d73cb 100644 --- a/meta/recipes-connectivity/kea/files/kea-dhcp-ddns.service +++ b/meta/recipes-connectivity/kea/files/kea-dhcp-ddns.service | |||
@@ -6,7 +6,6 @@ After=time-sync.target | |||
6 | 6 | ||
7 | [Service] | 7 | [Service] |
8 | ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/run/kea/ | 8 | ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/run/kea/ |
9 | ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/kea | ||
10 | ExecStart=@SBINDIR@/kea-dhcp-ddns -c @SYSCONFDIR@/kea/kea-dhcp-ddns.conf | 9 | ExecStart=@SBINDIR@/kea-dhcp-ddns -c @SYSCONFDIR@/kea/kea-dhcp-ddns.conf |
11 | 10 | ||
12 | [Install] | 11 | [Install] |
diff --git a/meta/recipes-connectivity/kea/kea_1.7.10.bb b/meta/recipes-connectivity/kea/kea_1.7.10.bb deleted file mode 100644 index 1d011ace78..0000000000 --- a/meta/recipes-connectivity/kea/kea_1.7.10.bb +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | SUMMARY = "ISC Kea DHCP Server" | ||
2 | DESCRIPTION = "Kea is the next generation of DHCP software developed by ISC. It supports both DHCPv4 and DHCPv6 protocols along with their extensions, e.g. prefix delegation and dynamic updates to DNS." | ||
3 | HOMEPAGE = "http://kea.isc.org" | ||
4 | SECTION = "connectivity" | ||
5 | LICENSE = "MPL-2.0 & Apache-2.0" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=68d95543d2096459290a4e6b9ceccffa" | ||
7 | |||
8 | DEPENDS = "boost log4cplus openssl" | ||
9 | |||
10 | SRC_URI = "\ | ||
11 | http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.gz \ | ||
12 | file://0001-keactrl.in-create-var-lib-kea-and-var-run-kea-folder.patch \ | ||
13 | file://kea-dhcp4.service \ | ||
14 | file://kea-dhcp6.service \ | ||
15 | file://kea-dhcp-ddns.service \ | ||
16 | file://kea-dhcp4-server \ | ||
17 | file://kea-dhcp6-server \ | ||
18 | file://kea-dhcp-ddns-server \ | ||
19 | file://fix-multilib-conflict.patch \ | ||
20 | file://fix_pid_keactrl.patch \ | ||
21 | " | ||
22 | SRC_URI[sha256sum] = "4e121f0e58b175a827581c69cb1d60778647049fa47f142940dddc9ce58f3c82" | ||
23 | |||
24 | inherit autotools systemd update-rc.d upstream-version-is-even | ||
25 | |||
26 | INITSCRIPT_NAME = "kea-dhcp4-server" | ||
27 | INITSCRIPT_PARAMS = "defaults 30" | ||
28 | |||
29 | SYSTEMD_SERVICE_${PN} = "kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service" | ||
30 | SYSTEMD_AUTO_ENABLE = "disable" | ||
31 | |||
32 | DEBUG_OPTIMIZATION_remove_mips = " -Og" | ||
33 | DEBUG_OPTIMIZATION_append_mips = " -O" | ||
34 | BUILD_OPTIMIZATION_remove_mips = " -Og" | ||
35 | BUILD_OPTIMIZATION_append_mips = " -O" | ||
36 | |||
37 | DEBUG_OPTIMIZATION_remove_mipsel = " -Og" | ||
38 | DEBUG_OPTIMIZATION_append_mipsel = " -O" | ||
39 | BUILD_OPTIMIZATION_remove_mipsel = " -Og" | ||
40 | BUILD_OPTIMIZATION_append_mipsel = " -O" | ||
41 | |||
42 | EXTRA_OECONF = "--with-boost-libs=-lboost_system \ | ||
43 | --with-log4cplus=${STAGING_DIR_TARGET}${prefix} \ | ||
44 | --with-openssl=${STAGING_DIR_TARGET}${prefix}" | ||
45 | |||
46 | do_configure_prepend() { | ||
47 | # replace abs_top_builddir to avoid introducing the build path | ||
48 | # don't expand the abs_top_builddir on the target as the abs_top_builddir is meanlingless on the target | ||
49 | find ${S} -type f -name *.sh.in | xargs sed -i "s:@abs_top_builddir@:@abs_top_builddir_placeholder@:g" | ||
50 | sed -i "s:@abs_top_srcdir@:@abs_top_srcdir_placeholder@:g" ${S}/src/bin/admin/kea-admin.in | ||
51 | } | ||
52 | |||
53 | do_install_append() { | ||
54 | install -d ${D}${sysconfdir}/init.d | ||
55 | install -d ${D}${systemd_system_unitdir} | ||
56 | |||
57 | install -m 0644 ${WORKDIR}/kea-dhcp*service ${D}${systemd_system_unitdir} | ||
58 | install -m 0755 ${WORKDIR}/kea-*-server ${D}${sysconfdir}/init.d | ||
59 | sed -i -e 's,@SBINDIR@,${sbindir},g' -e 's,@BASE_BINDIR@,${base_bindir},g' \ | ||
60 | -e 's,@LOCALSTATEDIR@,${localstatedir},g' -e 's,@SYSCONFDIR@,${sysconfdir},g' \ | ||
61 | ${D}${systemd_system_unitdir}/kea-dhcp*service ${D}${sbindir}/keactrl | ||
62 | } | ||
63 | |||
64 | do_install_append() { | ||
65 | rm -rf "${D}${localstatedir}" | ||
66 | } | ||
67 | |||
68 | CONFFILES_${PN} = "${sysconfdir}/kea/keactrl.conf" | ||
69 | |||
70 | FILES_${PN}-staticdev += "${libdir}/kea/hooks/*.a ${libdir}/hooks/*.a" | ||
71 | FILES_${PN} += "${libdir}/hooks/*.so" | ||
72 | |||
73 | PARALLEL_MAKEINST = "" | ||
diff --git a/meta/recipes-connectivity/kea/kea_2.6.3.bb b/meta/recipes-connectivity/kea/kea_2.6.3.bb new file mode 100644 index 0000000000..1df91e4522 --- /dev/null +++ b/meta/recipes-connectivity/kea/kea_2.6.3.bb | |||
@@ -0,0 +1,80 @@ | |||
1 | SUMMARY = "ISC Kea DHCP Server" | ||
2 | DESCRIPTION = "Kea is the next generation of DHCP software developed by ISC. It supports both DHCPv4 and DHCPv6 protocols along with their extensions, e.g. prefix delegation and dynamic updates to DNS." | ||
3 | HOMEPAGE = "http://kea.isc.org" | ||
4 | SECTION = "connectivity" | ||
5 | LICENSE = "MPL-2.0" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=ee16e7280a6cf2a1487717faf33190dc" | ||
7 | |||
8 | DEPENDS = "boost log4cplus openssl" | ||
9 | |||
10 | SRC_URI = "http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.gz \ | ||
11 | file://kea-dhcp4.service \ | ||
12 | file://kea-dhcp6.service \ | ||
13 | file://kea-dhcp-ddns.service \ | ||
14 | file://kea-dhcp4-server \ | ||
15 | file://kea-dhcp6-server \ | ||
16 | file://kea-dhcp-ddns-server \ | ||
17 | file://fix-multilib-conflict.patch \ | ||
18 | file://fix_pid_keactrl.patch \ | ||
19 | file://0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch \ | ||
20 | file://0001-make-kea-environment-available-to-lfc.patch \ | ||
21 | " | ||
22 | SRC_URI[sha256sum] = "00241a5955ffd3d215a2c098c4527f9d7f4b203188b276f9a36250dd3d9dd612" | ||
23 | |||
24 | inherit autotools systemd update-rc.d upstream-version-is-even | ||
25 | |||
26 | INITSCRIPT_NAME = "kea-dhcp4-server" | ||
27 | INITSCRIPT_PARAMS = "defaults 30" | ||
28 | |||
29 | SYSTEMD_SERVICE:${PN} = "kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service" | ||
30 | SYSTEMD_AUTO_ENABLE = "disable" | ||
31 | |||
32 | DEBUG_OPTIMIZATION:remove:mips = " -Og" | ||
33 | DEBUG_OPTIMIZATION:append:mips = " -O" | ||
34 | BUILD_OPTIMIZATION:remove:mips = " -Og" | ||
35 | BUILD_OPTIMIZATION:append:mips = " -O" | ||
36 | |||
37 | DEBUG_OPTIMIZATION:remove:mipsel = " -Og" | ||
38 | DEBUG_OPTIMIZATION:append:mipsel = " -O" | ||
39 | BUILD_OPTIMIZATION:remove:mipsel = " -Og" | ||
40 | BUILD_OPTIMIZATION:append:mipsel = " -O" | ||
41 | |||
42 | CXXFLAGS:remove = "-fvisibility-inlines-hidden" | ||
43 | EXTRA_OECONF = "--with-boost-libs=-lboost_system \ | ||
44 | --with-log4cplus=${STAGING_DIR_TARGET}${prefix} \ | ||
45 | --with-openssl=${STAGING_DIR_TARGET}${prefix}" | ||
46 | |||
47 | do_configure:prepend() { | ||
48 | # replace abs_top_builddir to avoid introducing the build path | ||
49 | # don't expand the abs_top_builddir on the target as the abs_top_builddir is meanlingless on the target | ||
50 | find ${S} -type f -name *.sh.in | xargs sed -i "s:@abs_top_builddir@:@abs_top_builddir_placeholder@:g" | ||
51 | sed -i "s:@abs_top_builddir@:@abs_top_builddir_placeholder@:g" ${S}/src/bin/admin/kea-admin.in | ||
52 | } | ||
53 | |||
54 | # patch out build host paths for reproducibility | ||
55 | do_compile:prepend:class-target() { | ||
56 | sed -i -e "s,${WORKDIR},,g" ${B}/config.report | ||
57 | } | ||
58 | |||
59 | do_install:append() { | ||
60 | install -d ${D}${sysconfdir}/init.d | ||
61 | install -d ${D}${systemd_system_unitdir} | ||
62 | |||
63 | install -m 0644 ${UNPACKDIR}/kea-dhcp*service ${D}${systemd_system_unitdir} | ||
64 | install -m 0755 ${UNPACKDIR}/kea-*-server ${D}${sysconfdir}/init.d | ||
65 | sed -i -e 's,@SBINDIR@,${sbindir},g' -e 's,@BASE_BINDIR@,${base_bindir},g' \ | ||
66 | -e 's,@LOCALSTATEDIR@,${localstatedir},g' -e 's,@SYSCONFDIR@,${sysconfdir},g' \ | ||
67 | ${D}${systemd_system_unitdir}/kea-dhcp*service ${D}${sbindir}/keactrl | ||
68 | sed -i "s:${B}:@abs_top_builddir_placeholder@:g" ${D}${sbindir}/kea-admin | ||
69 | } | ||
70 | |||
71 | do_install:append() { | ||
72 | rm -rf "${D}${localstatedir}" | ||
73 | } | ||
74 | |||
75 | CONFFILES:${PN} = "${sysconfdir}/kea/keactrl.conf" | ||
76 | |||
77 | FILES:${PN}-staticdev += "${libdir}/kea/hooks/*.a ${libdir}/hooks/*.a" | ||
78 | FILES:${PN} += "${libdir}/hooks/*.so" | ||
79 | |||
80 | PARALLEL_MAKEINST = "" | ||