diff options
author | Patrick Wicki <patrick.wicki@siemens.com> | 2023-11-30 03:55:25 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-11-29 22:25:05 -0800 |
commit | a5f13e6231da1a480eaac3bff4f9253c9a8adbca (patch) | |
tree | d03990a16434395144b8dfcb35eb9c117bb29a11 /meta-networking | |
parent | f4972749457329dfe4f01f26116720401b6df0da (diff) | |
download | meta-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.nm | 7 | ||||
-rw-r--r-- | meta-networking/recipes-daemons/squid/squid_6.5.bb | 8 |
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 | |||
3 | case "$2" in | ||
4 | up|down|vpn-up|vpn-down) | ||
5 | systemctl -q reload squid.service || : | ||
6 | ;; | ||
7 | esac | ||
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 | ||
25 | SRC_URI:remove:toolchain-clang = "file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch" | 26 | SRC_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 | |||
49 | PACKAGECONFIG[esi] = "--enable-esi,--disable-esi,expat libxml2" | 50 | PACKAGECONFIG[esi] = "--enable-esi,--disable-esi,expat libxml2" |
50 | PACKAGECONFIG[ssl] = "--with-openssl=yes,--with-openssl=no,openssl" | 51 | PACKAGECONFIG[ssl] = "--with-openssl=yes,--with-openssl=no,openssl" |
51 | 52 | ||
53 | PACKAGES =+ "${PN}-networkmanager" | ||
54 | |||
52 | BASIC_AUTH = "DB SASL LDAP" | 55 | BASIC_AUTH = "DB SASL LDAP" |
53 | 56 | ||
54 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | 57 | DEPENDS += "${@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 | ||
114 | FILES:${PN} += "${libdir} ${datadir}/errors ${datadir}/icons" | 121 | FILES:${PN} += "${libdir} ${datadir}/errors ${datadir}/icons" |
115 | FILES:${PN}-dbg += "/usr/src/debug" | 122 | FILES:${PN}-dbg += "/usr/src/debug" |
116 | FILES:${PN}-doc += "${datadir}/*.txt" | 123 | FILES:${PN}-doc += "${datadir}/*.txt" |
124 | FILES:${PN}-networkmanager = "${libdir}/NetworkManager/dispatcher.d" | ||
117 | 125 | ||
118 | RDEPENDS:${PN} += "perl" | 126 | RDEPENDS:${PN} += "perl" |
119 | RDEPENDS:${PN}-ptest += "perl make" | 127 | RDEPENDS:${PN}-ptest += "perl make" |