Add a logrotate config for Suricata

This commit is contained in:
Ahmed Shawky
2020-09-22 02:49:07 +00:00
parent bae5572a6c
commit 779bb91bf5

View File

@@ -468,6 +468,22 @@ install_suricata() {
echo "Suricata attempted to start but is not running. Exiting" echo "Suricata attempted to start but is not running. Exiting"
exit 1 exit 1
fi fi
cat >/etc/logrotate.d/suricata <<EOF
/var/log/suricata/*.log /var/log/suricata/*.json
{
hourly
rotate 0
missingok
nocompress
size=500M
sharedscripts
postrotate
/bin/kill -HUP \`cat /var/run/suricata.pid 2>/dev/null\` 2>/dev/null || true
endscript
}
EOF
} }
test_suricata_prerequisites() { test_suricata_prerequisites() {