Bug 517753
Summary: | RFE: Connect "@daily" and "@weekly" to anacron | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Tim Landscheidt <tim> |
Component: | cronie | Assignee: | Ondřej Pohořelský <opohorel> |
Status: | ASSIGNED --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | rawhide | CC: | mmaslano, pertusus, tmraz |
Target Milestone: | --- | Keywords: | FutureFeature |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Enhancement | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | Type: | --- | |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Attachments: |
Description
Tim Landscheidt
2009-08-16 17:31:03 UTC
That's good proposal. Though I'm not sure how easy (fast) will be implementing this feature. I gave it a try and implemented a rough cut. As anacron is a prerequisite to cronie, it was easier than I thought. The patch adds a message receiver to cron that triggers jobs marked with @daily, @weekly or @monthly to be run. I kept the @midnight alias as meaning "midnight". The process is triggered by cron-{daily,weekly,monthly}.c that is put into /etc/cron.{daily,weekly,monthly}. To do: 1. Review messaging especially for security. My understanding is that the message queue is only accessible to root, but it would be nice if somebody could confirm that :-). 2. Package cron-{daily,weekly,monthly}.c correctly. My knowledge of automake & Co. is too shallow for that ATM. 3. Decide on a good file name for /etc/cron.{daily,weekly,monthly}/cron-{daily,weekly,monthly}. I do not consider the duplication very attractive. 4. Decide whether it is desirable to put binaries into /etc/cron.{daily,weekly,monthly} or instead have a /usr/bin/crontrigger that accepts "DAILY", "WEEKLY" and "MONTHLY" as argument and three small shell one-liners in /etc/cron.{daily,weekly,monthly} that call this program. I'm slightly inclined to the former as it is simpler. Created attachment 377637 [details]
Patch to add daily/weekly/monthly functionality to cron.
Created attachment 377638 [details]
Trigger to run daily cron jobs (to be put in /etc/cron.daily).
Created attachment 377639 [details]
Trigger to run weekly cron jobs (to be put in /etc/cron.daily).
Created attachment 377640 [details]
Trigger to run monthly cron jobs (to be put in /etc/cron.daily).
The security of the use of the message queue is probably OK. There might be some problems with SELinux labels especially in regards to MLS though however these might be solved later. There should be definitely only one binary to send the messages, placed in the /usr/sbin directory. The problem is what to do if the cronie-anacron is not installed. This should be probably solved just by the cronie-noanacron so the jobs are triggered from there. However it means that even without anacron the jobs would be no longer run at the times specified in the manual page so the manual page should be adjusted appropriately. And there should be probably a new command line option for cron which would make it to disable the message queue receiver and schedule the jobs at the current fixed times. (In reply to comment #7) > [...] > There should be definitely only one binary to send the messages, placed in the > /usr/sbin directory. I will post a short "crontrigger" later. I tried to include it in a patch/.spec, but patching only src/Makefile.ac didn't cut it, and I don't know which parts of autoconf/automake to run and files to compare to have a "meaningful" patch. > The problem is what to do if the cronie-anacron is not installed. This should > be probably solved just by the cronie-noanacron so the jobs are triggered from > there. However it means that even without anacron the jobs would be no longer > run at the times specified in the manual page so the manual page should be > adjusted appropriately. > And there should be probably a new command line option for cron which would > make it to disable the message queue receiver and schedule the jobs at the > current fixed times. As I'm still using F11, I didn't delve into that. In a revision of the original patch, I added an option "-a" that *enables* the interaction with anacron and made it the default via /etc/sysconfig/crond. If the option is not supplied or the message queue cannot be set up, it falls back to the old behaviour. configure.ac has to be amended to check for sys/msg.h. As per above, I don't know how to do that efficiently per .spec. Created attachment 377767 [details]
Revised patch.
sys/msg.h has to be included in configure.ac and dependents.
Created attachment 377768 [details]
Generic trigger (to be put in /usr/sbin).
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. |