From 01a3fe43f8d098b784f14674acea56e2390d1a53 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Sat, 30 Jul 2016 08:06:24 +0200 Subject: [PATCH] new: [host] log ``shorewall`` message out from ``/var/log/kern.log`` towards it own directory. --- precise/host/hooks/install.d/90-shorewall.sh | 49 ++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/precise/host/hooks/install.d/90-shorewall.sh b/precise/host/hooks/install.d/90-shorewall.sh index 23967c9..ccdc34c 100755 --- a/precise/host/hooks/install.d/90-shorewall.sh +++ b/precise/host/hooks/install.d/90-shorewall.sh @@ -97,5 +97,54 @@ fi EOF + +## +## Logs +## + +mkdir -p /var/log/shorewall +chgrp syslog /var/log/shorewall +chmod g+w /var/log/shorewall + +cat < /etc/rsyslog.d/shorewall.conf +:msg, contains, "Shorewall:" /var/log/shorewall/main.log +& ~ +EOF + +cat < /etc/logrotate.d/shorewall +/var/log/shorewall/init.log { + weekly + rotate 4 + compress + missingok + create 0640 root adm +} + +/var/log/shorewall/main.log +{ + rotate 7 + weekly + missingok + notifempty + compress + delaycompress + postrotate + reload rsyslog >/dev/null 2>&1 || true + endscript +} + +EOF + +## Init logs +sed -ri 's%^(STARTUP_LOG=).*$%\1/var/log/shorewall/init.log%g' /etc/shorewall/shorewall.conf + +service rsyslog restart + + +## +## +## + + ## Activate support for docker sed -ri 's/^DOCKER=No$/DOCKER=Yes/g' /etc/shorewall/shorewall.conf