Browse Source

new: [host] log ``shorewall`` message out from ``/var/log/kern.log`` towards it own directory.

postgres
Valentin Lab 9 years ago
parent
commit
01a3fe43f8
  1. 49
      precise/host/hooks/install.d/90-shorewall.sh

49
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 <<EOF > /etc/rsyslog.d/shorewall.conf
:msg, contains, "Shorewall:" /var/log/shorewall/main.log
& ~
EOF
cat <<EOF > /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
Loading…
Cancel
Save