Issue #2462 has been updated by Simon Mudd.

I think there are 2 issues here.
# Puppet currently complains if I explicitly use '*' as a value. It's not 
mentioned in the documentation though it seems to work. I'd prefer this to be 
documented more clearly and to NOT get a warning when using it. By all means 
provide a different value if that's really needed, but I think most people know 
what '*' means in cron.
# Current default behaviour to run minutely jobs could be dangerous. I'd prefer 
a warning and nothing to happen if no periods are defined at all. That's safer.


----------------------------------------
Bug #2462: cron resources default behaviour with no periods seems potentially 
dangerous
http://projects.reductivelabs.com/issues/2462

Author: Simon Mudd
Status: Unreviewed
Priority: Normal
Assigned to: 
Category: 
Target version: 
Complexity: Unknown
Affected version: 0.24.8
Keywords: 


As per http://reductivelabs.com/trac/puppet/wiki/TypeReference#cron

"cron

Installs and manages cron jobs. All fields except the command and the user are 
optional, although specifying no periodic fields would result in the command 
being executed every minute. While the name of the cron job is not part of the 
actual job, it is used by Puppet to store and retrieve it."

I think this behaviour is dangerous as it means that default behaviour is a to 
run a minutely job. That means that if the period fields are not specified by 
mistake the effect will be to generate very frequent cron activity.

I used to configure my cron jobs like this:

 cron {
        'minutely_script':
                command     => '/path/to/minutely/script',
                ensure      => present,
                hour        => '*',
                minute      => '*',
 }

However this generates extra logging, making it look like the configuration is 
incorrect (or not expected):

Wed Jul 29 15:45:17 +0200 2009 
//Node[dc01mdb-01.mydomain.com]/s_db/s_db::config/Cron[db_config]/hour 
(notice): defined 'hour' as '*'
Wed Jul 29 15:45:19 +0200 2009 
//Node[dc01mdb-01.mydomain.com]/s_db/s_db::cron/Cron[log_processlist]/minute 
(notice): defined 'minute' as '*'
Wed Jul 29 15:45:19 +0200 2009 
//Node[dc01mdb-01.mydomain.com]/s_db/s_db::cron/Cron[log_processlist]/hour 
(notice): defined 'hour' as '*'

>From my point of view the correct cron entries were being created.

A colleague of mine said:

"Nasty, if you forget the timings, you get the worst case of the most frequent 
run of your job. I would make the arguments required and not optional. Cron 
jobs that need to run every minute are rare in the real world so that shouldn't 
be the default."

I tend to agree. I would prefer that it's possible define '*' without getting 
special notifications, and perhaps even that if no period fields are specified 
that a warning is generated.

Also the documentation should say that it's possible to specify '*' for "all 
values in that period".

We are using a custom built rpm based on puppet-0.24.8-1 on centos4 and 5.


-- 
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://reductivelabs.com/redmine/my/account

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

Reply via email to