aboutsummaryrefslogtreecommitdiff
path: root/straper/db/public/logging/logrotate.d
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukasz.kasprzak@pm.me>2026-03-20 19:16:32 +0100
committerLukasz Kasprzak <lukasz.kasprzak@pm.me>2026-03-20 19:16:32 +0100
commit39711cf6c2ec5a3b4480dcb4800cc3802bda5bf2 (patch)
tree9221704f413398cfb5d5759083b1e7032566820e /straper/db/public/logging/logrotate.d
parent6b59b75c3a294060dea66bdee16ffaf95ae92889 (diff)
downloadbin-39711cf6c2ec5a3b4480dcb4800cc3802bda5bf2.tar.gz
bin-39711cf6c2ec5a3b4480dcb4800cc3802bda5bf2.zip
feat: first fully successful run e2e on straper
Diffstat (limited to 'straper/db/public/logging/logrotate.d')
-rw-r--r--straper/db/public/logging/logrotate.d/alternatives9
-rw-r--r--straper/db/public/logging/logrotate.d/apt16
-rw-r--r--straper/db/public/logging/logrotate.d/btmp7
-rw-r--r--straper/db/public/logging/logrotate.d/certbot6
-rw-r--r--straper/db/public/logging/logrotate.d/dpkg9
-rw-r--r--straper/db/public/logging/logrotate.d/fail2ban19
-rw-r--r--straper/db/public/logging/logrotate.d/i2pd9
-rw-r--r--straper/db/public/logging/logrotate.d/mariadb59
-rw-r--r--straper/db/public/logging/logrotate.d/nginx18
-rw-r--r--straper/db/public/logging/logrotate.d/ppp9
-rw-r--r--straper/db/public/logging/logrotate.d/prometheus9
-rw-r--r--straper/db/public/logging/logrotate.d/prometheus-node-exporter9
-rw-r--r--straper/db/public/logging/logrotate.d/prosody12
-rw-r--r--straper/db/public/logging/logrotate.d/tor15
-rw-r--r--straper/db/public/logging/logrotate.d/unattended-upgrades10
-rw-r--r--straper/db/public/logging/logrotate.d/wtmp8
-rw-r--r--straper/db/public/logging/logrotate.d/wtmpdb7
17 files changed, 231 insertions, 0 deletions
diff --git a/straper/db/public/logging/logrotate.d/alternatives b/straper/db/public/logging/logrotate.d/alternatives
new file mode 100644
index 0000000..41c8a9c
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/alternatives
@@ -0,0 +1,9 @@
+/var/log/alternatives.log {
+ monthly
+ rotate 12
+ compress
+ delaycompress
+ missingok
+ notifempty
+ create 644 root root
+}
diff --git a/straper/db/public/logging/logrotate.d/apt b/straper/db/public/logging/logrotate.d/apt
new file mode 100644
index 0000000..9a6e5d1
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/apt
@@ -0,0 +1,16 @@
+/var/log/apt/term.log {
+ rotate 12
+ monthly
+ compress
+ missingok
+ notifempty
+}
+
+/var/log/apt/history.log {
+ rotate 12
+ monthly
+ compress
+ missingok
+ notifempty
+}
+
diff --git a/straper/db/public/logging/logrotate.d/btmp b/straper/db/public/logging/logrotate.d/btmp
new file mode 100644
index 0000000..0aa1ae1
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/btmp
@@ -0,0 +1,7 @@
+# no packages own btmp -- we'll rotate it here
+/var/log/btmp {
+ missingok
+ monthly
+ create 0660 root utmp
+ rotate 1
+}
diff --git a/straper/db/public/logging/logrotate.d/certbot b/straper/db/public/logging/logrotate.d/certbot
new file mode 100644
index 0000000..05caa95
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/certbot
@@ -0,0 +1,6 @@
+/var/log/letsencrypt/*.log {
+ rotate 12
+ weekly
+ compress
+ missingok
+} \ No newline at end of file
diff --git a/straper/db/public/logging/logrotate.d/dpkg b/straper/db/public/logging/logrotate.d/dpkg
new file mode 100644
index 0000000..cf36f08
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/dpkg
@@ -0,0 +1,9 @@
+/var/log/dpkg.log {
+ monthly
+ rotate 12
+ compress
+ delaycompress
+ missingok
+ notifempty
+ create 644 root root
+}
diff --git a/straper/db/public/logging/logrotate.d/fail2ban b/straper/db/public/logging/logrotate.d/fail2ban
new file mode 100644
index 0000000..892f5d2
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/fail2ban
@@ -0,0 +1,19 @@
+/var/log/fail2ban.log {
+
+ weekly
+ rotate 4
+ compress
+ # Do not rotate if empty
+ notifempty
+
+ delaycompress
+ missingok
+ postrotate
+ fail2ban-client flushlogs 1>/dev/null
+ endscript
+
+ # If fail2ban runs as non-root it still needs to have write access
+ # to logfiles.
+ # create 640 fail2ban adm
+ create 640 root adm
+}
diff --git a/straper/db/public/logging/logrotate.d/i2pd b/straper/db/public/logging/logrotate.d/i2pd
new file mode 100644
index 0000000..d0ca70a
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/i2pd
@@ -0,0 +1,9 @@
+"/var/log/i2pd/*.log" {
+ copytruncate
+ daily
+ rotate 5
+ compress
+ delaycompress
+ missingok
+ notifempty
+}
diff --git a/straper/db/public/logging/logrotate.d/mariadb b/straper/db/public/logging/logrotate.d/mariadb
new file mode 100644
index 0000000..985c7c2
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/mariadb
@@ -0,0 +1,59 @@
+# This is the MariaDB configuration for the logrotate utility
+#
+# Note that on most Linux systems logs are written to journald, which has its
+# own rotation scheme.
+#
+# Read https://mariadb.com/kb/en/error-log/ to learn more about logging and
+# https://mariadb.com/kb/en/rotating-logs-on-unix-and-linux/ about rotating logs.
+
+/var/lib/mysql/mysqld.log /var/lib/mysql/mariadb.log /var/log/mysql/*.log {
+
+ # Depends on a mysql@localhost unix_socket authenticated user with RELOAD privilege
+ #su mysql mysql
+
+ # If any of the files listed above is missing, skip them silently without
+ # emitting any errors
+ missingok
+
+ # If file exists but is empty, don't rotate it
+ notifempty
+
+ # Run monthly
+ monthly
+
+ # Keep 6 months of logs
+ rotate 6
+
+ # If file is growing too big, rotate immediately
+ maxsize 500M
+
+ # If file size is too small, don't rotate at all
+ minsize 50M
+
+ # Compress logs, as they are text and compression will save a lot of disk space
+ compress
+
+ # Don't compress the log immediately to avoid errors about "file size changed while zipping"
+ delaycompress
+
+ # Don't run the postrotate script for each file configured in this file, but
+ # run it only once if one or more files were rotated
+ sharedscripts
+
+ # After each rotation, run this custom script to flush the logs. Note that
+ # this assumes that the mariadb-admin command has database access, which it
+ # has thanks to the default use of Unix socket authentication for the 'mysql'
+ # (or root on Debian) account used everywhere since MariaDB 10.4.
+ postrotate
+ if test -r /etc/mysql/debian.cnf
+ then
+ EXTRAPARAM='--defaults-file=/etc/mysql/debian.cnf'
+ fi
+
+ if test -x /usr/bin/mariadb-admin
+ then
+ /usr/bin/mariadb-admin $EXTRAPARAM --local flush-error-log \
+ flush-engine-log flush-general-log flush-slow-log
+ fi
+ endscript
+}
diff --git a/straper/db/public/logging/logrotate.d/nginx b/straper/db/public/logging/logrotate.d/nginx
new file mode 100644
index 0000000..423c6ad
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/nginx
@@ -0,0 +1,18 @@
+/var/log/nginx/*.log {
+ daily
+ missingok
+ rotate 14
+ compress
+ delaycompress
+ notifempty
+ create 0640 www-data adm
+ sharedscripts
+ prerotate
+ if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
+ run-parts /etc/logrotate.d/httpd-prerotate; \
+ fi \
+ endscript
+ postrotate
+ invoke-rc.d nginx rotate >/dev/null 2>&1
+ endscript
+}
diff --git a/straper/db/public/logging/logrotate.d/ppp b/straper/db/public/logging/logrotate.d/ppp
new file mode 100644
index 0000000..3505463
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/ppp
@@ -0,0 +1,9 @@
+/var/log/ppp-connect-errors {
+ weekly
+ rotate 4
+ missingok
+ notifempty
+ compress
+ nocreate
+}
+
diff --git a/straper/db/public/logging/logrotate.d/prometheus b/straper/db/public/logging/logrotate.d/prometheus
new file mode 100644
index 0000000..40d373f
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/prometheus
@@ -0,0 +1,9 @@
+/var/log/prometheus/prometheus.log {
+ weekly
+ rotate 10
+ copytruncate
+ compress
+ delaycompress
+ notifempty
+ missingok
+}
diff --git a/straper/db/public/logging/logrotate.d/prometheus-node-exporter b/straper/db/public/logging/logrotate.d/prometheus-node-exporter
new file mode 100644
index 0000000..f8becf8
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/prometheus-node-exporter
@@ -0,0 +1,9 @@
+/var/log/prometheus/prometheus-node-exporter.log {
+ weekly
+ rotate 10
+ copytruncate
+ compress
+ delaycompress
+ notifempty
+ missingok
+}
diff --git a/straper/db/public/logging/logrotate.d/prosody b/straper/db/public/logging/logrotate.d/prosody
new file mode 100644
index 0000000..5407a18
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/prosody
@@ -0,0 +1,12 @@
+/var/log/prosody/prosody.log /var/log/prosody/prosody.err {
+ weekly
+ rotate 52
+ compress
+ delaycompress
+ create 640 prosody adm
+ postrotate
+ [ ! -e /run/prosody/prosody.pid ] || service prosody reload > /dev/null
+ endscript
+ sharedscripts
+ missingok
+}
diff --git a/straper/db/public/logging/logrotate.d/tor b/straper/db/public/logging/logrotate.d/tor
new file mode 100644
index 0000000..14c0ba8
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/tor
@@ -0,0 +1,15 @@
+/var/log/tor/*log {
+ daily
+ rotate 5
+ compress
+ delaycompress
+ missingok
+ notifempty
+ create 0640 debian-tor adm
+ sharedscripts
+ postrotate
+ if invoke-rc.d tor status > /dev/null; then
+ invoke-rc.d tor reload > /dev/null
+ fi
+ endscript
+}
diff --git a/straper/db/public/logging/logrotate.d/unattended-upgrades b/straper/db/public/logging/logrotate.d/unattended-upgrades
new file mode 100644
index 0000000..8393767
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/unattended-upgrades
@@ -0,0 +1,10 @@
+/var/log/unattended-upgrades/unattended-upgrades.log
+/var/log/unattended-upgrades/unattended-upgrades-dpkg.log
+/var/log/unattended-upgrades/unattended-upgrades-shutdown.log
+{
+ rotate 6
+ monthly
+ compress
+ missingok
+ notifempty
+}
diff --git a/straper/db/public/logging/logrotate.d/wtmp b/straper/db/public/logging/logrotate.d/wtmp
new file mode 100644
index 0000000..cc8a151
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/wtmp
@@ -0,0 +1,8 @@
+# no packages own wtmp -- we'll rotate it here
+/var/log/wtmp {
+ missingok
+ monthly
+ create 0664 root utmp
+ minsize 1M
+ rotate 1
+}
diff --git a/straper/db/public/logging/logrotate.d/wtmpdb b/straper/db/public/logging/logrotate.d/wtmpdb
new file mode 100644
index 0000000..cbfc00e
--- /dev/null
+++ b/straper/db/public/logging/logrotate.d/wtmpdb
@@ -0,0 +1,7 @@
+/var/log/wtmp.db {
+ missingok
+ yearly
+ create
+ nocompress
+ rotate 4
+}