Browse Source

Merge pull request #12619 from Cynerd/syslog-ng-network-failover

syslog-ng: detect disabled IPv6 on loopback and fallback to IPv4
lilik-openwrt-22.03
Josef Schlehofer 4 years ago
committed by GitHub
parent
commit
3ae230aee2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 2 deletions
  1. +4
    -1
      admin/syslog-ng/Makefile
  2. +6
    -0
      admin/syslog-ng/files/scl/network_localhost/detect.sh
  3. +1
    -0
      admin/syslog-ng/files/scl/network_localhost/plugin.conf
  4. +1
    -1
      admin/syslog-ng/files/syslog-ng.conf

+ 4
- 1
admin/syslog-ng/Makefile View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=syslog-ng PKG_NAME:=syslog-ng
PKG_VERSION:=3.27.1 PKG_VERSION:=3.27.1
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_MAINTAINER:=Josef Schlehofer <josef.schlehofer@nic.cz> PKG_MAINTAINER:=Josef Schlehofer <josef.schlehofer@nic.cz>
PKG_LICENSE:=LGPL-2.1-or-later GPL-2.0-or-later PKG_LICENSE:=LGPL-2.1-or-later GPL-2.0-or-later
@ -87,6 +87,9 @@ define Package/syslog-ng/install
$(INSTALL_DIR) $(1)/sbin $(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) ./files/logread $(1)/sbin $(INSTALL_BIN) ./files/logread $(1)/sbin
$(INSTALL_DIR) $(1)/usr/share/syslog-ng/include/
$(CP) -r ./files/scl $(1)/usr/share/syslog-ng/include/
endef endef
define Package/syslog-ng/postinst define Package/syslog-ng/postinst


+ 6
- 0
admin/syslog-ng/files/scl/network_localhost/detect.sh View File

@ -0,0 +1,6 @@
#!/bin/sh
if [ "$(sysctl net.ipv6.conf.lo.disable_ipv6 | cut -d' ' -f 3)" = "0" ]; then
echo 'network(ip("::1") port(514) transport(udp) ip-protocol(6) )'
else
echo 'network(ip("127.0.0.1") port(514) transport(udp) ip-protocol(4) )'
fi

+ 1
- 0
admin/syslog-ng/files/scl/network_localhost/plugin.conf View File

@ -0,0 +1 @@
@module confgen context(source) name(network_localhost) exec("`scl-root`/network_localhost/detect.sh")

+ 1
- 1
admin/syslog-ng/files/syslog-ng.conf View File

@ -26,7 +26,7 @@ source src {
}; };
source net { source net {
network(ip("::1") port(514) transport(udp) ip-protocol(6));
network_localhost();
}; };
source s_network { source s_network {


Loading…
Cancel
Save