logrotate / iptraf error - 2024-07-22

logrotate.service doesn't start

systemcl status logrotate.service
sudo journalctl -xeu logrotate.service

jui 22 20:30:17 machinename logrotate[711]: error: iptraf-ng:2 duplicate log entry for /var/log/iptraf/*.log
jui 22 20:30:17 machinename logrotate[711]: error: found error in file iptraf-ng, skipping
jui 22 20:30:20 machinename systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE

This is caused by keeping iptraf and iptraf-ng at the same. Bug report in debian here: 860568 iptraf-ng: cron spam due to duplicated logrotate rules.

Solution: remove iptraf. apt remove iptraf. Doesn't work because the package is not installed. apt --purge remove iptraf will remove the configuration file

Conflicting file:

# ls -l /etc/logrotate.d
-rw-r--r-- 1 root root 151  4 oct  2012 iptraf
-rw-r--r-- 1 root root 135 27 mar  2017 iptraf-ng

Check:

# dpkg -S # dpkg -S /etc/logrotate.d/iptraf
iptraf: /etc/logrotate.d/iptraf

dpkg -l iptraf*
# rc = removed but with config files
rc  iptraf         1:1.1.4-6    all          transitional package to iptraf-ng
ii  iptraf-ng      1:1.2.1-1    amd64        Next Generation Interactive Colorful IP LAN Monitor

# after a purge, dpkg -l iptraf become "un" Unknown Not-installed.
# see man dpkg-query

After purging the configuration file of iptraf, use sudo systemctl start logrotate.service

dpkg fail

error install dpkg because missing
/usr/sbin/start-stop-daemon  from dpkg

open /var/cache/apt/archives/dpkg.....deb  in file-roller
extract usr/bin/start-stop-daemon
cp in /usr/sbin
apt install dpkg