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 <adriano.oliveira@windriver.com>
Change-Id: I66a2800d1639890cdbd5972d9f018215580da46c
This commit is contained in:
aoliveir 2022-02-23 21:46:44 +00:00
parent bb2c23a7eb
commit d03ab8fa54
3 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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#