From d03ab8fa54ef060b1148709d6e2030eba50c7428 Mon Sep 17 00:00:00 2001 From: aoliveir Date: Wed, 23 Feb 2022 21:46:44 +0000 Subject: [PATCH] Fix syslog-ng: config, service and package Following the man page and document: https://manpages.debian.org/unstable/syslog-ng-core/ syslog-ng.conf.5.en.html https://www.freedesktop.org/wiki/Software/systemd/syslog/ The definition of the syslog-ng service file was changed to use "Requires" instead of "Sockets" on the Unit section. On CentOS, the version of syslog-ng is older, and these docs seems to apply to newer versions (CentOS: 2015 vs Debian: 2020). Also, the source for the messages on syslog-ng config file should be changed since a socket is used on the journal: syslog.socket. (socket: /run/systemd/journal/syslog) The syslog-ng package had to add an explicit enable on the service to have the override applied on the service. Test Plan: PASS: ISO build successfully PASS: ISO installed successfully PASS: After installation syslog.socket and syslog-ng are Running PASS: Upon adding "management_interface=lo" to platform.conf mtce logs start to appear Story: 2009256 Task: 44598 Signed-off-by: aoliveir Change-Id: I66a2800d1639890cdbd5972d9f018215580da46c --- syslog-ng-config/debian-source/syslog-ng.conf | 6 ++++-- syslog-ng-config/debian-source/syslog-ng.service | 2 +- syslog-ng-config/debian/deb_folder/postinst | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/syslog-ng-config/debian-source/syslog-ng.conf b/syslog-ng-config/debian-source/syslog-ng.conf index b2f0bd0..b84ac21 100644 --- a/syslog-ng-config/debian-source/syslog-ng.conf +++ b/syslog-ng-config/debian-source/syslog-ng.conf @@ -63,8 +63,10 @@ options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); # This is the default behavior of sysklogd package # Logs may come from unix stream, but not from another machine. # -source s_src { systemd-journal(); internal(); - file("/proc/kmsg" program_override("kernel") ); +source s_src { + systemd-syslog(); + file("/proc/kmsg" program-override("kernel") flags(kernel)); + internal(); }; # If you wish to get logs from remote machine you should uncomment diff --git a/syslog-ng-config/debian-source/syslog-ng.service b/syslog-ng-config/debian-source/syslog-ng.service index 606a967..06c0263 100644 --- a/syslog-ng-config/debian-source/syslog-ng.service +++ b/syslog-ng-config/debian-source/syslog-ng.service @@ -1,10 +1,10 @@ [Unit] Description=System Logger Daemon Documentation=man:syslog-ng(8) +Requires=syslog.socket [Service] Type=notify -Sockets=syslog.socket ExecStartPre=-/usr/bin/mkdir -p /var/run/syslog-ng/ ExecStart=/usr/sbin/syslog-ng -F -p /var/run/syslog-ng/syslog-ng.pid ExecReload=/bin/kill -HUP $MAINPID diff --git a/syslog-ng-config/debian/deb_folder/postinst b/syslog-ng-config/debian/deb_folder/postinst index 2350845..4fac6ac 100644 --- a/syslog-ng-config/debian/deb_folder/postinst +++ b/syslog-ng-config/debian/deb_folder/postinst @@ -9,4 +9,6 @@ cp /usr/share/starlingx/syslog-ng.service /usr/lib/systemd/system/syslog-ng.serv chmod 700 /usr/sbin/fm_event_syslogger chmod 755 /usr/sbin/sshlog +systemctl enable syslog-ng.service > /dev/null 2>&1 || : + #DEBHELPER#