I have 4 custom systemd services that write to custom logs in /var/log/
. I set up a logrotate
config file, but it is not writing to the newest log. It is still writing to the old .log.1
file. The new ones are created, just no data.
Here is my logrotate config:
/var/log/dealer*.log {
daily
missingok
rotate 7
delaycompress
notifempty
su root root
postrotate
/bin/systemctl reload dealer*.service > /dev/null 2>/dev/null || true
endscript
create 0644 root root
}
The newest log files are empty:
-rw-r--r-- 1 root root 0 Jul 12 11:39 dealerF2f.log
-rw-r--r-- 1 root root 0 Jul 12 11:39 dealerOutbound.log
-rw-r--r-- 1 root root 0 Jul 12 11:39 dealerTimeout.log
-rw-r--r-- 1 root root 0 Jul 12 11:39 dealerWeb.log
It is still writing to the .log.1
:
-rw-r--r-- 1 root root 36M Jul 12 12:52 dealerOutbound.log.1
-rw-r--r-- 1 root root 9.2M Jul 12 12:52 dealerF2f.log.1
-rw-r--r-- 1 root root 19M Jul 12 12:52 dealerWeb.log.1
-rw-r--r-- 1 root root 171M Jul 12 12:52 dealerTimeout.log.1