Issue #4820 has been updated by Felix Frank.

Alright, I'm starting to see why cron was considered broken badly.

There are few tickets left with the cronfixit keyword, but searching the fix 
for this one, I start seeing how this won't be so easy.

The way I see it, the fileparsing support is not quite fit to handle two 
seperate kinds of records, i.e. "regular" crontab lines vs. FreeBSD special 
lines such as "@reboot <command>".

Another bad effect I noticed: Having the provider change *any* existing record 
towards a (different) special schedule will work, but break the crontab such 
that the "Puppet name" comment is lost and subsequent changes will create a 
duplicate instead.

It gets funnier when mixing the special schedule with numeric fields: The 
provider will correctly match the now nameless line, but writing it back 
correctly fails all the same.

I think I'll go ahead and try unifying the different record types. The code 
will be uglier, but it may work. Which would be a good deal I believe.
----------------------------------------
Feature #4820: cron type should not allow specification of special parameter 
and normal hour/minute/day/etc parameters.
https://projects.puppetlabs.com/issues/4820#change-84433

Author: micah -
Status: Accepted
Priority: Normal
Assignee: Nigel Kersten
Category: cron
Target version: 
Affected Puppet version: 
Keywords: cronfixit
Branch: 


As it is now, if you specify a 'special' parameter to the cron provider, while 
*also* providing other hour/minute/day/etc parameters, only the special 
parameter is applied:

<pre>
# cat /tmp/test_special_cron.pp
cron { "test_special":
         command => "/bin/true",
         hour => "*/6",
         special => "reboot";
}
# puppet /tmp/test_special_cron.pp
notice: /Stage[main]//Cron[test_special]/ensure: created
# crontab -l
# HEADER: This file was autogenerated at Wed Sep 22 11:02:54 -0400 2010 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: test_special
@reboot /bin/true
</pre>

You will notice that *only* the "@reboot" line was added, when I clearly also 
specified "hour => */6". 

Since cron specials typically do not conflict with a regular cron entry, I was 
expecting two cron entries to be made, one for the @reboot, and one for the */6 
hourly. 

I can understand the argument that you might want people explicitly specify 
separate cron resources, and not let people do this. If that is what you 
prefer, then I would change my bug report to request that you notify the user 
somehow that they've specified a parameter that will not be applied.



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to