The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #6593

Cron loses track of crontab easily, results in duplicates

Added by Nick Moffitt over 3 years ago. Updated over 3 years ago.

Status:DuplicateStart date:03/04/2011
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:cron
Target version:-
Affected Puppet version:2.6.4 Branch:
Keywords:cron duplicate crontab

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


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

Duplicates Puppet - Bug #775: Cron resources being deleted still require a command. Closed

History

#1 Updated by donavan m over 3 years ago

I’m pretty sure this is a dupe of #775.

#2 Updated by Nick Moffitt over 3 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 3 years ago

  • Status changed from Unreviewed to Duplicate

Also available in: Atom PDF