syslog/syslog-lib.sh: Match rsyslog config written by RainerScript
PATCH 1/1 syslog/syslog-lib.sh: Match rsyslog config written by RainerScript
Since rsyslog commit 3b55048094d759adf8162f0829f239e115ebf2c0, rsyslog by default deletes log socket during restart, unless socket is provided by systemd.
If default rsyslog config written by RainerScript uses imjournal module (e.g. module(load="imjournal"...) and doesn't specify $SystemLogSocketName, syslog-lib.sh cannot match imjournal module and just write imuxsock module into the rsyslog.conf constructed by test. In this case, "/dev/log" is owned by journald but rsyslog deletes it as its default log socket after testing.
--- testcases/kernel/syscalls/syslog/syslog-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/syslog/syslog-lib.sh +1 -1
@@ -71,7 +71,7 @@ setup() CONFIG_FILE="/etc/syslog-ng/syslog-ng.conf" elif [ "$SYSLOG_DAEMON" = "rsyslog" ]; then CONFIG_FILE="/etc/rsyslog.conf" - if grep -q -r '^\$ModLoad[[:space:]]*imjournal' /etc/rsyslog.conf /etc/rsyslog.d/ ; then + if grep -qri '^[^#].*load.*imjournal' /etc/rsyslog.conf /etc/rsyslog.d/ ; then systemd_journal=$(grep -Ehoi "^[^#].*(imjournal|workdirectory).*" -r /etc/rsyslog.conf /etc/rsyslog.d/) RSYSLOG_CONFIG=$(cat <<EOF $systemd_journal
Signature · 1 line
1.8.3.1
PATCH 1/1 syslog/syslog-lib.sh: Match rsyslog config written by RainerScript
----- Original Message -----
Quoted 4 lines
Since rsyslog commit
3b55048094d759adf8162f0829f239e115ebf2c0, rsyslog by default deletes log socket during restart, unless socket is provided by systemd.
Quoted 8 lines
If default rsyslog config written by RainerScript uses imjournal module (e.g.
module(load="imjournal"...)and doesn't specify $SystemLogSocketName,syslog-lib.shcannot match imjournal module and just write imuxsock module into the rsyslog.conf constructed by test. In this case, "/dev/log" is owned by journald but rsyslog deletes it as its default log socket after testing.Signed-off-by Xiao Yang <[email protected]>
Pushed with added comment what patterns is the grep targetting.
Thanks,
Jan