From 79d694fe0328481eb1980722170ab00ddfa68f94 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zolt=C3=A1n=20Felleg?= Date: Thu, 9 Dec 2021 00:00:43 +0100 Subject: [PATCH] Updated ls.in (updated rsyslog and logrotate rules). --- sources/ls.in/postinstall/20_setuprsyslog.sh | 8 ++++++-- .../ls.in/postinstall/install/etc/logrotate.d/remote | 11 +++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 sources/ls.in/postinstall/install/etc/logrotate.d/remote diff --git a/sources/ls.in/postinstall/20_setuprsyslog.sh b/sources/ls.in/postinstall/20_setuprsyslog.sh index 1e00c30..04ae3c8 100755 --- a/sources/ls.in/postinstall/20_setuprsyslog.sh +++ b/sources/ls.in/postinstall/20_setuprsyslog.sh @@ -3,8 +3,12 @@ mv /etc/rsyslog.conf /etc/rsyslog.conf.orig -sed -e 's/^#module(load="imudp")/module(load="imudp")/' \ +sed --in-place=.orig \ + -e 's/^#module(load="imudp")/module(load="imudp")/' \ -e 's/^#input(type="imudp" port="514")/input(type="imudp" port="514")/' \ -e 's/^#module(load="imtcp")/module(load="imtcp")/' \ -e 's/^#input(type="imtcp" port="514")/input(type="imtcp" port="514")/' \ - /etc/rsyslog.conf + /etc/rsyslog.conf + +echo >>/etc/rsyslog.conf +echo "*.* /var/log/remote/everything.log" >>/etc/rsyslog.conf diff --git a/sources/ls.in/postinstall/install/etc/logrotate.d/remote b/sources/ls.in/postinstall/install/etc/logrotate.d/remote new file mode 100644 index 0000000..667fec8 --- /dev/null +++ b/sources/ls.in/postinstall/install/etc/logrotate.d/remote @@ -0,0 +1,11 @@ +/var/log/remote/everything.log +{ + rotate -1 + daily + missingok + compress + dateext + postrotate + /usr/bin/systemctl kill -s HUP rsyslog.service >/dev/null 2>&1 || true + endscript +} -- 2.54.0