about summary refs log tree commit diff stats
path: root/tools/conf/etc/logrotate.d/samhain
diff options
context:
space:
mode:
authorSilvino Silva <silvino@bk.ru>2017-09-03 11:09:44 +0100
committerSilvino Silva <silvino@bk.ru>2017-09-03 11:09:44 +0100
commit0201cd199cbf5c60182881f4cdb4a6a9bf3e9b8c (patch)
tree4670f4e3c01e79175f37bdaa57bf37f41131dc9c /tools/conf/etc/logrotate.d/samhain
parent46329d66252eb37e731f670705f6085db74a93f7 (diff)
downloaddoc-0201cd199cbf5c60182881f4cdb4a6a9bf3e9b8c.tar.gz
added logrotate configuration
Diffstat (limited to 'tools/conf/etc/logrotate.d/samhain')
-rw-r--r--tools/conf/etc/logrotate.d/samhain24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/conf/etc/logrotate.d/samhain b/tools/conf/etc/logrotate.d/samhain
new file mode 100644
index 0000000..d60f810
--- /dev/null
+++ b/tools/conf/etc/logrotate.d/samhain
@@ -0,0 +1,24 @@
+/var/log/samhain.log {
+    weekly
+    rotate 52
+    nocreate
+    missingok
+    compress
+
+    prerotate
+        if test -f /var/run/samhain.pid; then \
+          PIN=`cat /var/run/samhain.pid`; \
+          /bin/kill -TTIN $PIN; \
+          sleep 1; \
+          AA=0; \
+          while test "x$AA" != "x120"; do \
+           AA=$(( AA + 1 )); \
+           if test -f /var/log/samhain.log.lock; then \
+             sleep 1; \
+           else \
+             break; \
+           fi \
+          done; \
+        fi
+    endscript
+}