#324 Poor Packaging:CronFiles guidelines
Closed: Fixed None Opened 6 years ago by ppisar.

New [http://fedoraproject.org/wiki/Packaging:CronFiles] guide lines have some difficulties:

(1) [http://fedoraproject.org/wiki/Packaging:CronFiles#Cron_Job_Files_on_the_filesystem] reads:

Packages with cron job files must be placed into one or more of the following directories /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, /etc/cron.monthly depending on the intended interval they should run.

Packages should be placed into the directories? I guess files.

(2) [http://fedoraproject.org/wiki/Packaging:CronFiles#Cron_Job_file] defines ''Cron job file'' as a script. This is confusing with a helper script placed somewhere in the libexec or bin directory and linked from a crontab. One could doubt if these helpers are cron job files too and should be marked as configuration files too. Especially if the guidelines talk about the helper as cron job files:

In this case, the cron job file (the script) must be placed in an appropriate system location [...], and NOT in /etc/cron.d.

The guide lines need rewording.


(1) Is a clarification. I reworded it some. Should be fixed.

(2) I think needs a draft and voting. But I could be misunderstanding what you are asking for. """All cron job files installed in any of these directories must be scripts and must be treated as configuration files so that they can easily be modified by the local system administrator.""" would seem to imply that you shouldn't symlink something from /usr/libexec or /usr/bin into the cron directories (as that would remove the ability for the system admin to easily modify it). Under current guidelines, I think the proper thing to do is having a wrapper script added to the cron directory that just invokes the helper script.

In actual use in Fedora Infrastructure, this practice would be of use as we sometimes modify cron jobs to do things like:

  • Create a lock so that we don't have two instances of the cron job running at the same time.
  • If the cron job errors, only send that error once per day instead of at every invocation.

with a wrapper script, we can do these by modifying the wrapper.

Reading that section multiple times I'm not sure if we were intentionally creating this situation or not though. After all, it's easy enough to rm the symlink and create a wrapper script in its place. Anyhow... a draft (or examples if I'm misunderstanding) would probably better for this portion.

(1)

Thanks.

(2)

That's misunderstanding. The ''linked'' meant to refer, to execute the helper from a cron job script or a crontab. Noting about creating file system links. My apology for pure wording.

The whole point is current guidelines use ''cron job file'' for two different things. For files put under /etc/cron.* and for helpers. And the guidelines state that cron job files have to marked as configuration files. That implies that helpers have to be marked as configuration files which is wrong.

Revised wording:

add "Helper files used by cron job files should be placed in appropriate system locations (e.g. %{_bindir} or %{_libexecdir}) and do not need to be marked as %config."

change this line: "All cron job files installed in any of these directories must be scripts and must be treated as configuration files so that they can easily be modified by the local system administrator."

TO

"Both cron job files and crontab definition files installed in any of these directories must be treated as configuration files so that they can easily be modified by the local system administrator."

Approved (+1:6, 0:0, -1:0)

Announcement text:

Packaging guidelines for cron files (https://fedoraproject.org/wiki/Packaging:CronFiles) have been clarified.

Login to comment on this ticket.

Metadata