summaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorPatrick Wicki <patrick.wicki@siemens.com>2023-11-30 03:55:25 +0100
committerKhem Raj <raj.khem@gmail.com>2023-11-29 22:25:05 -0800
commita5f13e6231da1a480eaac3bff4f9253c9a8adbca (patch)
treed03990a16434395144b8dfcb35eb9c117bb29a11 /meta-networking
parentf4972749457329dfe4f01f26116720401b6df0da (diff)
downloadmeta-openembedded-a5f13e6231da1a480eaac3bff4f9253c9a8adbca.tar.gz
squid: add nm dispatcher reload hook
This enables the networkmanager dispatcher to reload squid automatically on network changes. This idea is from the Fedora package where they do the same: https://src.fedoraproject.org/rpms/squid/blob/rawhide/f/squid.spec#_207 Signed-off-by: Patrick Wicki <patrick.wicki@siemens.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-daemons/squid/files/squid.nm7
-rw-r--r--meta-networking/recipes-daemons/squid/squid_6.5.bb8
2 files changed, 15 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/squid/files/squid.nm b/meta-networking/recipes-daemons/squid/files/squid.nm
new file mode 100644
index 000000000..b58ee11bd
--- /dev/null
+++ b/meta-networking/recipes-daemons/squid/files/squid.nm
@@ -0,0 +1,7 @@
1#!/bin/sh
2
3case "$2" in
4 up|down|vpn-up|vpn-down)
5 systemctl -q reload squid.service || :
6 ;;
7esac
diff --git a/meta-networking/recipes-daemons/squid/squid_6.5.bb b/meta-networking/recipes-daemons/squid/squid_6.5.bb
index 3795da7f5..33a8bc476 100644
--- a/meta-networking/recipes-daemons/squid/squid_6.5.bb
+++ b/meta-networking/recipes-daemons/squid/squid_6.5.bb
@@ -20,6 +20,7 @@ SRC_URI = "http://www.squid-cache.org/Versions/v${MAJ_VER}/${BPN}-${PV}.tar.bz2
20 file://volatiles.03_squid \ 20 file://volatiles.03_squid \
21 file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch \ 21 file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch \
22 file://0002-squid-make-squid-conf-tests-run-on-target-device.patch \ 22 file://0002-squid-make-squid-conf-tests-run-on-target-device.patch \
23 file://squid.nm \
23 " 24 "
24 25
25SRC_URI:remove:toolchain-clang = "file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch" 26SRC_URI:remove:toolchain-clang = "file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch"
@@ -49,6 +50,8 @@ PACKAGECONFIG[werror] = "--enable-strict-error-checking,--disable-strict-error-c
49PACKAGECONFIG[esi] = "--enable-esi,--disable-esi,expat libxml2" 50PACKAGECONFIG[esi] = "--enable-esi,--disable-esi,expat libxml2"
50PACKAGECONFIG[ssl] = "--with-openssl=yes,--with-openssl=no,openssl" 51PACKAGECONFIG[ssl] = "--with-openssl=yes,--with-openssl=no,openssl"
51 52
53PACKAGES =+ "${PN}-networkmanager"
54
52BASIC_AUTH = "DB SASL LDAP" 55BASIC_AUTH = "DB SASL LDAP"
53 56
54DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" 57DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
@@ -109,11 +112,16 @@ do_install:append() {
109 112
110 rmdir "${D}${localstatedir}/log/${BPN}" 113 rmdir "${D}${localstatedir}/log/${BPN}"
111 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/log" 114 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/log"
115
116 # Install NetworkManager dispatcher reload hooks
117 install -d ${D}${libdir}/NetworkManager/dispatcher.d
118 install -m 0755 ${WORKDIR}/squid.nm ${D}${libdir}/NetworkManager/dispatcher.d/20-squid
112} 119}
113 120
114FILES:${PN} += "${libdir} ${datadir}/errors ${datadir}/icons" 121FILES:${PN} += "${libdir} ${datadir}/errors ${datadir}/icons"
115FILES:${PN}-dbg += "/usr/src/debug" 122FILES:${PN}-dbg += "/usr/src/debug"
116FILES:${PN}-doc += "${datadir}/*.txt" 123FILES:${PN}-doc += "${datadir}/*.txt"
124FILES:${PN}-networkmanager = "${libdir}/NetworkManager/dispatcher.d"
117 125
118RDEPENDS:${PN} += "perl" 126RDEPENDS:${PN} += "perl"
119RDEPENDS:${PN}-ptest += "perl make" 127RDEPENDS:${PN}-ptest += "perl make"