Bug #6593
Cron loses track of crontab easily, results in duplicates
| Status: | Duplicate | Start date: | 03/04/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% | |
| Category: | cron | |||
| Target version: | - | |||
| Affected Puppet version: | 2.6.4 | Branch: | ||
| Keywords: | cron duplicate crontab | |||
Description
On a system with several root crontab entries modeled as cron resources, I took one out of my manifests as it was no longer needed.
This of course did not remove the entry in the crontab, so I did a quick cron { "name_of_old_entry": ensure => absent, } to clear it out. Puppet then started spouting errors about lack of a command parameter, but kept running.
I added the old entries back as they once were, this time with added ensure=>absent parameters, and was delighted to see them vanish. However, now several other entries appear to have been duplicated, like so:
# HEADER: This file was autogenerated at Wed Mar 02 22:29:47 +0000 2011 by puppet.
# HEADER: While it can still be managed manually, it is definitely not recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
# Puppet Name: pullhaps
*/9 * * * * cd /var/lib/happening_clients/ && for i in *; do rsync -aq --delete $i::haps/ /var/lib/haps/$i/; done
# Puppet Name: stuff_monitor
7,17,27,37,47,57 * * * * /usr/local/sbin/stuff-monitor
# Puppet Name: check_zootboot
23 */3 * * * /usr/local/sbin/check-zootboot
# Puppet Name: gubble_update_base
4,34 * * * * /usr/local/sbin/gubble-update base
# Puppet Name: gubble_update_all
23 2 * * * /usr/local/sbin/gubble-update all
# Puppet Name: lshw
10 23 * * * lshw -short -disable scsi > /var/lib/nagios/lshw.txt
# Puppet Name: lshw
10 23 * * * lshw -short -disable scsi > /var/lib/nagios/lshw.txt
# Puppet Name: gubble_update_base
4,34 * * * * /usr/local/sbin/gubble-update base
# Puppet Name: gubble_update_all
23 2 * * * /usr/local/sbin/gubble-update all
# Puppet Name: check_zootboot
23 */3 * * * /usr/local/sbin/check-zootboot
Fortunately my scripts all have locks preventing collisions (except for that lshw up there, which is bothering me the most), but it generates a lot of spam mail from cron right now. I plan to delete the upper set manually and see if puppet recognizes the bottom ones as its own, but it’s kind of confusing to me that puppet can’t uniquely identify a crontab entry it made, interim syntax gaffe or no.
Related issues
History
#1
Updated by donavan m over 2 years ago
I’m pretty sure this is a dupe of #775.
#2
Updated by Nick Moffitt over 2 years ago
donavan m wrote:
I’m pretty sure this is a dupe of #775.
Ugh. It almost certainly is. How disappointing.
#3
Updated by James Turnbull over 2 years ago
- Status changed from Unreviewed to Duplicate