Issue #2462 has been updated by Simon Mudd.
Hi Luke. The answer to "why bother" to specify these is simple: make the configuration explicit, not implicit. It's much easier to not spot a mistake in a configuration when an action is not SPECIFICALLY mentioned. That's what makes me uneasy. Most cron jobs do NOT run every minute, though there are some that might do (and I was configuring such a job), therefore to have the default behaviour to run every minute seems not to be ideal. If you want to run jobs every minute then as I suggested allow that and also DO NOT complain about explicitly using '*' when specifying the hour or minute. Again maybe this is just an issue about clearer documentation for this type of resource, and the edge cases. The current message is not very helpful: 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 '*' If this is not needed then say so: 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 '*' unnecessarily. Please remove the hour => '*' entry as this is the behaviour if not specified. I'd still prefer a clearer way to explicitly specify minutely jobs. ---------------------------------------- Bug #2462: cron resources default behaviour with no periods seems potentially dangerous http://projects.reductivelabs.com/issues/2462 Author: Simon Mudd Status: Needs design decision Priority: Normal Assigned to: Category: cron 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 -~----------~----~----~----~------~----~------~--~---
