|
@ -97,5 +97,54 @@ fi |
|
|
|
|
|
|
|
|
EOF |
|
|
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 |
|
|
## Activate support for docker |
|
|
sed -ri 's/^DOCKER=No$/DOCKER=Yes/g' /etc/shorewall/shorewall.conf |
|
|
sed -ri 's/^DOCKER=No$/DOCKER=Yes/g' /etc/shorewall/shorewall.conf |