Description of problem: after updating to the last package version atop service do not log correctly, old files are not deleted after X days as stated in atop.daily, and logging itself randomly stop writing log files, even if atop still continue to write in the cache file. Version-Release number of selected component (if applicable): atop-2.6.0-3.el7 How reproducible: install atop, configure /usr/share/atop/atop.daily , enable and start the related service, observe files in /var/log/atop . Steps to Reproduce: 1. yum install atop 2. sed -i 's/600/60/' /etc/sysconfig/atop 3. sed -i 's/600/60/' /usr/share/atop/atop.daily 4. sed -i 's/28/7/' /usr/share/atop/atop.daily 5. systemctl start atop 6. systemctl enable atop 7. ls -lh /var/log/atop 8. ls -lh /var/cache/atop Actual results: New log files are not written/created Old log files are not deleted Expected results: New log files are written/created Old log files are deleted Additional info:
Version 2.6.0-5 in updates-testing corrects this issue.
I am sorry, but the issue still exists after upgrading to the package version 2.6.0-5 in updates-testing.
Did you replace /etc/sysconfig/atop with the newly-created /etc/sysconfig/atop.rpmnew?
here is my /etc/sysconfig/atop : # sysconfig atop # # Current Day format CURDAY=`date +%Y%m%d` # Log files path LOGPATH=/var/log/atop # Binaries path BINPATH=/usr/bin # PID File PIDFILE=/var/run/atop.pid # interval (default 10 minutes) LOGINTERVAL=60 LOGOPTS="" LOGGENERATIONS=7 I added the last two lines from the new file to the previous file. I also noticed that the file /var/log/atop/daily.log keep the creation date instead of changing every day as in atop old rpm version. This issue apply in x86_64 from precompiled rpm and in s390x compiled from source rpm.
Replace the old file with the new file, completely.
I replaced the file, now /etc/sysconfig/atop contains : LOGOPTS="" LOGINTERVAL=60 LOGGENERATIONS=7 LOGPATH=/var/log/atop as I restarted the service (systemctl restart atop) it was deleted an old log file, but still the file /var/log/atop/daily.log do not update his date. I will update you tomorrow about the log rotation.
[root@xxxxxxxx ~]# ls -lh /var/log/atop total 116M -rw-r--r--. 1 root root 6.5M Apr 1 00:00 atop_20210331 -rw-r--r--. 1 root root 13M Apr 2 00:00 atop_20210401 -rw-r--r--. 1 root root 13M Apr 3 00:00 atop_20210402 -rw-r--r--. 1 root root 13M Apr 4 00:00 atop_20210403 -rw-r--r--. 1 root root 13M Apr 5 00:00 atop_20210404 -rw-r--r--. 1 root root 12M Apr 6 00:00 atop_20210405 -rw-r--r--. 1 root root 31M Apr 8 07:58 atop_20210406 -rw-r--r--. 1 root root 14M Apr 9 08:41 atop_20210408 -rw-r--r--. 1 root root 0 Apr 6 00:00 daily.log [root@xxxxxxxx ~]# systemctl status atop ● atop.service - Atop advanced performance monitor Loaded: loaded (/usr/lib/systemd/system/atop.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2021-04-08 15:39:29 CEST; 17h ago Docs: man:atop(1) Process: 29348 ExecStartPost=/usr/bin/find ${LOGPATH} -name atop_* -mtime +${LOGGENERATIONS} -exec rm -v {} ; (code=exited, status=0/SUCCESS) Process: 29343 ExecStartPre=/bin/sh -c test -n "$LOGGENERATIONS" -a "$LOGGENERATIONS" -eq "$LOGGENERATIONS" (code=exited, status=0/SUCCESS) Process: 29341 ExecStartPre=/bin/sh -c test -n "$LOGINTERVAL" -a "$LOGINTERVAL" -eq "$LOGINTERVAL" (code=exited, status=0/SUCCESS) Main PID: 29347 (atop) Tasks: 1 Memory: 13.9M CGroup: /system.slice/atop.service └─29347 /usr/bin/atop -w /var/log/atop/atop_20210408 60 Apr 08 15:39:29 xxxxxxxx systemd[1]: Starting Atop advanced performance monitor... Apr 08 15:39:29 xxxxxxxx find[29348]: removed ‘/var/log/atop/atop_20210319’ Apr 08 15:39:29 xxxxxxxx systemd[1]: Started Atop advanced performance monitor. [root@xxxxxxxx ~]# find /var/log/atop -name atop_* -mtime +7 /var/log/atop/atop_20210331 [root@x0svdsa1 ~]# cat /etc/sysconfig/atop LOGOPTS="" LOGINTERVAL=60 LOGGENERATIONS=7 LOGPATH=/var/log/atop It still doesn't delete old logs, I mean older than LOGGENERATIONS value.
Is the automated daily restart working?
How could I check if automated daily restart is working?
By the way, on the same machines if I remove the new package and I install the old package there is no issue anymore, so the issue should be in the new rpm package IMHO. It seems to me that atop service start well then after some time it does not work well anymore.
FEDORA-2021-9f7491e4a7 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-9f7491e4a7
FEDORA-2021-db5b54a405 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-db5b54a405
FEDORA-2021-01bf42fd5c has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2021-01bf42fd5c
FEDORA-2021-db5b54a405 has been pushed to the Fedora 34 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-db5b54a405` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-db5b54a405 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-9f7491e4a7 has been pushed to the Fedora 33 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-9f7491e4a7` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-9f7491e4a7 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
I do not use Fedora, I installed atop rpm package from EPEL repository inside RHEL7 and RHEL8. I will not add Fedora repositories to RHEL machines.
This bug is referenced by updates to both EPEL and Fedora, you may ignore the Fedora comments.
FEDORA-EPEL-2021-667b444f64 has been pushed to the Fedora EPEL 8 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-667b444f64 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2021-76dc640120 has been pushed to the Fedora EPEL 7 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-76dc640120 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-01bf42fd5c has been pushed to the Fedora 32 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-01bf42fd5c` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-01bf42fd5c See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-9f7491e4a7 has been pushed to the Fedora 33 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2021-01bf42fd5c has been pushed to the Fedora 32 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2021-db5b54a405 has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-EPEL-2021-667b444f64 has been pushed to the Fedora EPEL 8 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-EPEL-2021-76dc640120 has been pushed to the Fedora EPEL 7 stable repository. If problem still persists, please make note of it in this bug report.
The same issue still persists after the upgrade to the latest version (atop-2.6.0-6.el8 atop-2.6.0-6.el7): the atop logs don't rotate.
And this is with the replaced /etc/sysconfig/atop? And after sudo systemctl daemon-reload and sudo systemctl restart atop?
Yes, I confirm that I replaced /etc/sysconfig/atop , systemctl daemon-reload and systemctl restart atop , the atop log rotate only during "systemctl restart atop" but do not rotate every night at midnight like it should do.
Interesting. How often does it rotate, and what's in your /etc/sysconfig/atop?
Here is the content of /etc/sysconfig/atop [root@x0svdsa1 ~]# cat /etc/sysconfig/atop LOGOPTS="" LOGINTERVAL=60 LOGGENERATIONS=7 LOGPATH=/var/log/atop [root@x0svdsa1 ~]# ls -lh /var/log/atop total 265M -rw-r--r--. 1 root root 161M Apr 29 16:00 atop_20210416 -rw-r--r--. 1 root root 8.7M Apr 30 09:20 atop_20210429 -rw-r--r--. 1 root root 50M May 4 07:26 atop_20210430 -rw-r--r--. 1 root root 30M May 6 16:29 atop_20210504 -rw-r--r--. 1 root root 0 Apr 6 00:00 daily.log [root@x0svdsa1 ~]# it rotates only after "systemctl restart atop" and only if the last log file is from a previous day. In previous version of the atop rpm package it rotates correctly every night at midnight.
Is the timer enabled? sudo systemctl status atop-rotate.timer If not, sudo systemctl enable atop-rotate.timer
I did as you suggested: [root@x0svdsa1 ~]# systemctl status atop-rotate.timer ● atop-rotate.timer - Daily atop restart Loaded: loaded (/usr/lib/systemd/system/atop-rotate.timer; disabled; vendor preset: disabled) Active: inactive (dead) [root@x0svdsa1 ~]# systemctl enable --now atop-rotate.timer Created symlink from /etc/systemd/system/timers.target.wants/atop-rotate.timer to /usr/lib/systemd/system/atop-rotate.timer. [root@x0svdsa1 ~]# systemctl status atop-rotate.timer ● atop-rotate.timer - Daily atop restart Loaded: loaded (/usr/lib/systemd/system/atop-rotate.timer; enabled; vendor preset: disabled) Active: active (waiting) since Thu 2021-05-06 17:31:41 CEST; 7s ago May 06 17:31:41 x0svdsa1 systemd[1]: Started Daily atop restart. [root@x0svdsa1 ~]# I was not aware of this change in the new rpm package, atop rpm package version 2.4.0-4.el7 did not provided this timer: [root@x0cecdc1 ~]# systemctl status atop-rotate.timer Unit atop-rotate.timer could not be found. [root@x0cecdc1 ~]# systemctl status atop ● atop.service - Atop advanced performance monitor Loaded: loaded (/usr/lib/systemd/system/atop.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2021-05-06 00:00:02 CEST; 17h ago Docs: man:atop(1) Main PID: 20711 (atop) Tasks: 1 Memory: 44.6M CGroup: /system.slice/atop.service └─20711 /usr/bin/atop -w /var/log/atop/atop_20210506 60 May 06 00:00:02 x0cecdc1 systemd[1]: Started Atop advanced performance monitor. [root@x0cecdc1 ~]# rpm -qa | grep atop atop-2.4.0-4.el7_9.s390x [root@x0cecdc1 ~]# I will verify tomorrow and I will report back. Thank you very much.
You're very welcome, and good luck!
Atop logs rotates correctly now.
Excellent!