Bug 445174 - There is a bad cron entry provided by atop
Summary: There is a bad cron entry provided by atop
Alias: None
Product: Fedora
Classification: Fedora
Component: atop
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Kairo Araujo
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2008-05-05 06:16 UTC by Bruno Wolff III
Modified: 2018-04-25 15:28 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2008-05-06 16:43:09 UTC

Attachments (Terms of Use)

Description Bruno Wolff III 2008-05-05 06:16:19 UTC
Description of problem:
In /etc/cron.d/atop there is a reference to /etc/atop/atop.daily which is NOT
provided by the atop package. (It looks like /etc/cron.d/atop might not be
unnecessary as /etc/cron.daily/atop may be doing the same thing.)
Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.yum install atop
2.Either look at the files directory or wait for the cron error message to be
Actual results:
Daily emails noting the problem with cron.

Expected results:
No daily emails about problems.

Additional info:

Comment 1 manuel wolfshant 2008-05-05 07:29:38 UTC
Indeed, /etc/cron.d/atop was superseded by /etc/cron.daily/atop and should no
longer be packaged.

Comment 2 Kairo Araujo 2008-05-05 21:00:05 UTC
Fixed in atop-1.23-7

Comment 3 Bruno Wolff III 2008-05-14 17:41:59 UTC
Can you push this to bodhi? It hasn't been pushed out to Fedora 9 at least. I
don't know about other places.

Comment 4 Brian Pitts 2010-06-28 16:08:25 UTC
Can someone reopen this bug?

It is still present in atop-1.23-10.fc12 and atop-1.23-8.el5

Comment 5 Brian Pitts 2010-06-29 15:34:57 UTC
Thinking more about this, it's not ideal to have the cron job responsible for restarting atop in /etc/cron.daily. Scripts there are set to run at 4AM by default, but atop's raw log file reading functionality works best if the raw log file is rotated at midnight.

This is illustrated in the manpage: "A  raw  file can be read and visualized again with the flag -r followed by  the   filename... If a filename is specified in the format yyyymmdd (where yyyymmdd are digits representing  any  valid       date), the file /var/log/atop/atop_yyyymmdd is opened."

One fix would be to move /etc/cron.daily/atop to somewhere like /usr/share/atop/restart_atop and have a file in /etc/cron.d that calls it at midnight. This is similar to what the sysstat package does.

Comment 6 Brian Pitts 2010-06-29 16:13:37 UTC
Another approach might be to eliminate /etc/cron.daily/atop altogether. The only difference I see between it and /usr/bin/atopd is that atopd will restart atop or start atop if it isn't already running, while the cron job will only restart atop. This makes sense, since you don't want atop to be started by the cron job when you haven't started the atop service.

However, /etc/rc.d/init/atop has a working condrestart function that will  execute /usr/bin/atopd only if /usr/bin/atop isn't already running. Using this from cron seems like a better approach then duplicating code between /usr/bin/atopd and /etc/cron.daily/atop.

Thus, my proposed fix to this bug is

1) Remove /etc/cron.daily/atop from the package
2) Change /etc/cron.d/atop to be

# start atop daily at midnight
0 0 * * * root /etc/rc.d/init.d/atop condrestart

This has the dual advantages of reducing code duplication and preserving the relationship between a raw log file's name and the day's data it contains.

Comment 7 Brian Pitts 2012-05-09 21:06:52 UTC
I'm doing what I describe in comment 6 in my environment; you can see a puppet module for it at https://github.com/sciurus/puppet-atop.

Comment 8 Alan Jenkins 2018-04-25 15:27:10 UTC
This bug has been fixed following comment 6, if someone with access would like to close it.

$ rpm -q atop

$ rpm -q --dump atop|grep cron
/etc/cron.d/atop 78 1514904906 8dc1ce7fc7daeb7f7ba097a55d19e817eac6e19f038840bcae2785281dd3a65f 0100644 root root 1 0 0 X

Comment 9 Alan Jenkins 2018-04-25 15:28:56 UTC
Gah, I got confused.  Sorry for the noise.

Note You need to log in before you can comment on or make changes to this bug.