From eeb24c76fdea1650a0c6266641890db101b8c3e4 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sun, 15 Dec 2019 18:06:55 +0100 Subject: community/kea: fix paths of control sockets --- community/kea/APKBUILD | 6 +- community/kea/configs-fix-paths.patch | 116 ++++++++++++++++++++++++++++++++++ community/kea/logs-location.patch | 69 -------------------- 3 files changed, 119 insertions(+), 72 deletions(-) create mode 100644 community/kea/configs-fix-paths.patch delete mode 100644 community/kea/logs-location.patch diff --git a/community/kea/APKBUILD b/community/kea/APKBUILD index ea0f9a70800..ffb649c1527 100644 --- a/community/kea/APKBUILD +++ b/community/kea/APKBUILD @@ -3,7 +3,7 @@ # Contributor: Jakub Jirutka pkgname=kea pkgver=1.7.2 -pkgrel=6 +pkgrel=7 pkgdesc="DHCPv4 and DHCPv6 server from ISC" url="http://kea.isc.org" # armhf, armv7: limited by log4cplus @@ -47,7 +47,7 @@ subpackages=" " source="https://ftp.isc.org/isc/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz disable-db-tests.patch - logs-location.patch + configs-fix-paths.patch use-runstatedir-for-pid-file-location.patch put-LOCKFILE_DIR-to-runstatedir.patch kea-admin-remove-builddir.patch @@ -251,7 +251,7 @@ _install_initd() { sha512sums="f84bed2e1dacd172c7aed8e4d6c11ec5e79f37ad2c7991963fc9c4a1761668f9f0e105ba5c4deed06264ab2ec13b1b5787350d823de12fd3782223192e3653f2 kea-1.7.2.tar.gz 55780bbcbd79b81d55bdccd46da6ca6babe8b7894aa82948308dc4f8a0e2b5d33fad633276696c8ba7bd063026bb11ae529a096375d0572833c66e2132888775 disable-db-tests.patch -4336bb6708d51729065da4dd3a3e96bbcbac7716b4bbde360af3c4599719c2fa9362055ae6c00043e7581f2f4af5a51d24f2e8cfaabefdb1f4d545c24af33f94 logs-location.patch +6d142d7ede2bd29a9133fe4e4a3ca6bab2b51a56926b268fab218921edd49250b240c0f59efa8a389b49a5478db5bda95acf531382b14cdf9327dddddcdb2d4d configs-fix-paths.patch 574b4aacef03c2d4a556b4ff8b152b66efd6fdc27ad09373d41c72df15f8a2cd2386e0bbe7e07f1370d9cd11e0954fc679f3d57e6b647d601cc06e0c63bc8712 use-runstatedir-for-pid-file-location.patch 062e6eb88c49aeeac5d78c37c43cda1ff753e19f833aaa1525e37f66eede819910d4849bd954f3ef8ceb1b13e747953c99e2a9a4d9755b6da8d82c4e08b2b55c put-LOCKFILE_DIR-to-runstatedir.patch 5b93d96f2cbdce327ffceef5ace19ba5327a0c7d0d61714e35a0d72912ecbbec6a1864249612b48f8db20dffc3622170c3e21b1a67297fd834f47b94db85b9d7 kea-admin-remove-builddir.patch diff --git a/community/kea/configs-fix-paths.patch b/community/kea/configs-fix-paths.patch new file mode 100644 index 00000000000..f79855dad8e --- /dev/null +++ b/community/kea/configs-fix-paths.patch @@ -0,0 +1,116 @@ +* We have to move logs from /var/log to /var/log/kea to allow running + under unprivileged user. +* /tmp is not a good location for control sockets, move them to /run/kea. + +--- a/src/bin/keactrl/kea-ctrl-agent.conf.pre ++++ b/src/bin/keactrl/kea-ctrl-agent.conf.pre +@@ -26,15 +26,15 @@ + "control-sockets": { + "dhcp4": { + "socket-type": "unix", +- "socket-name": "/tmp/kea4-ctrl-socket" ++ "socket-name": "/run/kea/kea-dhcp4-ctrl.sock" + }, + "dhcp6": { + "socket-type": "unix", +- "socket-name": "/tmp/kea6-ctrl-socket" ++ "socket-name": "/run/kea/kea-dhcp6-ctrl.sock" + }, + "d2": { + "socket-type": "unix", +- "socket-name": "/tmp/kea-ddns-ctrl-socket" ++ "socket-name": "/run/kea/kea-dhcp-ddns-ctrl.sock" + } + }, + +@@ -67,7 +67,7 @@ + // - syslog (logs to syslog) + // - syslog:name (logs to syslog using specified name) + // Any other value is considered a name of a time +- "output": "@localstatedir@/log/kea-ctrl-agent.log" ++ "output": "@localstatedir@/log/kea/kea-ctrl-agent.log" + + // Shorter log pattern suitable for use with systemd, + // avoids redundant information +--- a/src/bin/keactrl/kea-dhcp-ddns.conf.pre ++++ b/src/bin/keactrl/kea-dhcp-ddns.conf.pre +@@ -23,7 +23,7 @@ + "port": 53001, + "control-socket": { + "socket-type": "unix", +- "socket-name": "/tmp/ddns-ctrl-socket" ++ "socket-name": "/run/kea/kea-dhcp-ddns-ctrl.sock" + }, + "tsig-keys": [], + "forward-ddns" : {}, +@@ -44,7 +44,7 @@ + // - syslog (logs to syslog) + // - syslog:name (logs to syslog using specified name) + // Any other value is considered a name of a time +- "output": "@localstatedir@/log/kea-ddns.log" ++ "output": "@localstatedir@/log/kea/kea-ddns.log" + + // Shorter log pattern suitable for use with systemd, + // avoids redundant information +--- a/src/bin/keactrl/kea-dhcp4.conf.pre ++++ b/src/bin/keactrl/kea-dhcp4.conf.pre +@@ -49,7 +49,7 @@ + // more. For detailed description, see Sections 8.8, 16 and 15. + "control-socket": { + "socket-type": "unix", +- "socket-name": "/tmp/kea4-ctrl-socket" ++ "socket-name": "/run/kea/kea-dhcp4-ctrl.sock" + }, + + // Use Memfile lease database backend to store leases in a CSV file. +@@ -428,7 +428,7 @@ + // - syslog (logs to syslog) + // - syslog:name (logs to syslog using specified name) + // Any other value is considered a name of a time +- "output": "@localstatedir@/log/kea-dhcp4.log" ++ "output": "@localstatedir@/log/kea/kea-dhcp4.log" + + // Shorter log pattern suitable for use with systemd, + // avoids redundant information +--- a/src/bin/keactrl/kea-dhcp6.conf.pre ++++ b/src/bin/keactrl/kea-dhcp6.conf.pre +@@ -43,7 +43,7 @@ + // description, see Sections 9.12, 16 and 15. + "control-socket": { + "socket-type": "unix", +- "socket-name": "/tmp/kea6-ctrl-socket" ++ "socket-name": "/run/kea/kea-dhcp6-ctrl.sock" + }, + + // Use Memfile lease database backend to store leases in a CSV file. +@@ -353,7 +353,7 @@ + // - syslog (logs to syslog) + // - syslog:name (logs to syslog using specified name) + // Any other value is considered a name of a time +- "output": "@localstatedir@/log/kea-dhcp6.log" ++ "output": "@localstatedir@/log/kea/kea-dhcp6.log" + + // Shorter log pattern suitable for use with systemd, + // avoids redundant information +--- a/src/bin/keactrl/kea-netconf.conf.pre ++++ b/src/bin/keactrl/kea-netconf.conf.pre +@@ -69,7 +69,7 @@ + // - syslog (logs to syslog) + // - syslog:name (logs to syslog using specified name) + // Any other value is considered a name of a time +- "output": "@localstatedir@/log/kea-netconf.log" ++ "output": "@localstatedir@/log/kea/kea-netconf.log" + + // Shorter log pattern suitable for use with systemd, + // avoids redundant information +--- a/src/bin/keactrl/keactrl.in ++++ b/src/bin/keactrl/keactrl.in +@@ -333,7 +333,7 @@ + # to the default file. + if [ -z "${KEA_LOGGER_DESTINATION}" ]; then + prefix=@prefix@ +- export KEA_LOGGER_DESTINATION=@localstatedir@/log/kea.log ++ export KEA_LOGGER_DESTINATION=@localstatedir@/log/kea/kea.log + fi + + command=${1} diff --git a/community/kea/logs-location.patch b/community/kea/logs-location.patch deleted file mode 100644 index b55233b7bf0..00000000000 --- a/community/kea/logs-location.patch +++ /dev/null @@ -1,69 +0,0 @@ -We have to move logs from /var/log to /var/log/kea to allow running -under unprivileged user. - ---- a/src/bin/keactrl/kea-ctrl-agent.conf.pre -+++ b/src/bin/keactrl/kea-ctrl-agent.conf.pre -@@ -67,7 +67,7 @@ - // - syslog (logs to syslog) - // - syslog:name (logs to syslog using specified name) - // Any other value is considered a name of a time -- "output": "@localstatedir@/log/kea-ctrl-agent.log" -+ "output": "@localstatedir@/log/kea/kea-ctrl-agent.log" - - // Shorter log pattern suitable for use with systemd, - // avoids redundant information ---- a/src/bin/keactrl/kea-dhcp-ddns.conf.pre -+++ b/src/bin/keactrl/kea-dhcp-ddns.conf.pre -@@ -44,7 +44,7 @@ - // - syslog (logs to syslog) - // - syslog:name (logs to syslog using specified name) - // Any other value is considered a name of a time -- "output": "@localstatedir@/log/kea-ddns.log" -+ "output": "@localstatedir@/log/kea/kea-ddns.log" - - // Shorter log pattern suitable for use with systemd, - // avoids redundant information ---- a/src/bin/keactrl/kea-dhcp4.conf.pre -+++ b/src/bin/keactrl/kea-dhcp4.conf.pre -@@ -428,7 +428,7 @@ - // - syslog (logs to syslog) - // - syslog:name (logs to syslog using specified name) - // Any other value is considered a name of a time -- "output": "@localstatedir@/log/kea-dhcp4.log" -+ "output": "@localstatedir@/log/kea/kea-dhcp4.log" - - // Shorter log pattern suitable for use with systemd, - // avoids redundant information ---- a/src/bin/keactrl/kea-dhcp6.conf.pre -+++ b/src/bin/keactrl/kea-dhcp6.conf.pre -@@ -353,7 +353,7 @@ - // - syslog (logs to syslog) - // - syslog:name (logs to syslog using specified name) - // Any other value is considered a name of a time -- "output": "@localstatedir@/log/kea-dhcp6.log" -+ "output": "@localstatedir@/log/kea/kea-dhcp6.log" - - // Shorter log pattern suitable for use with systemd, - // avoids redundant information ---- a/src/bin/keactrl/kea-netconf.conf.pre -+++ b/src/bin/keactrl/kea-netconf.conf.pre -@@ -69,7 +69,7 @@ - // - syslog (logs to syslog) - // - syslog:name (logs to syslog using specified name) - // Any other value is considered a name of a time -- "output": "@localstatedir@/log/kea-netconf.log" -+ "output": "@localstatedir@/log/kea/kea-netconf.log" - - // Shorter log pattern suitable for use with systemd, - // avoids redundant information ---- a/src/bin/keactrl/keactrl.in -+++ b/src/bin/keactrl/keactrl.in -@@ -333,7 +333,7 @@ - # to the default file. - if [ -z "${KEA_LOGGER_DESTINATION}" ]; then - prefix=@prefix@ -- export KEA_LOGGER_DESTINATION=@localstatedir@/log/kea.log -+ export KEA_LOGGER_DESTINATION=@localstatedir@/log/kea/kea.log - fi - - command=${1} -- cgit v1.2.3