Bug #4241

Cron type behavior change

Added by Cody Robertson almost 2 years ago. Updated 4 months ago.

Status:Closed Start date:07/15/2010
Priority:High Due date:
Assignee:- % Done:

0%

Category:cron
Target version:-
Affected Puppet version:0.25.5 Branch:
Keywords:
Votes: 1

Description

I’ve recently re-deployed with a newer version (0.25.1 to 0.25.5) with the same cron configuration and I’m now getting different results

The cron config in question:

    # From example http://docs.puppetlabs.com/references/stable/type.html
    cron { "command":
        command => "/bin/command",
        user    => "root",
        hour    => [0,12],
    }   

In my previous setup (0.25.1) this produced the following in the crontab:

# Puppet Name: command
0 0,12 * * * /bin/command

Which according to the examples in the documentation is correct. However in my 0.25.5 deployment it produces:

# Puppet Name: command
* 0,12 * * * /bin/command

Clearly this will run every minute which is not the expected result. To fix this all you have to do is specify the minute parameter however this seems like a potentially dangerous change (bug?).


Related issues

blocks Puppet - Bug #6990: Rehabilitate cron provider Accepted 04/06/2011

History

Updated by Cody Robertson almost 2 years ago

I wasn’t clear that every minute in those hours instead of once each hour.

Updated by James Turnbull almost 2 years ago

  • Status changed from Unreviewed to Accepted
  • Assignee set to Markus Roberts

Updated by Robin Powell about 1 year ago

For what it’s worth, I’ve always seen no minute (or hour) field lead to *, it’s the behaviour that seems obvious and sensible to me (rather than picking a particular arbitrary value), and I have places that rely on it on Debian, CentOS and Gentoo. To be fair, mostly on pre-0.25.

So I’m very confused that a behaviour that has been totally consistent for me, across platforms, isn’t affecting everyone and is apparently going to be “fixed”?

-Robin

Updated by Robin Powell about 1 year ago

I’m sorry, I just realized that I only rely on this in the hour field, not the minute field. Having special behaviour for the minute field seems not very POLA to me, but it would at least explain what I’m seeing (and the apparent contradiction in http://projects.puppetlabs.com/issues/1453 )

-Robin

Updated by Joshua Lifton 5 months ago

  • Assignee deleted (Markus Roberts)

This issue was assigned to a former Puppet Labs employee. Adding back to the pool of unreviewed issues.

Updated by Joshua Lifton 5 months ago

This issue was assigned to a former Puppet Labs employee. Adding back to the pool of unreviewed issues.

Updated by Ben Hughes 4 months ago

  • Description updated (diff)
  • Status changed from Accepted to Unreviewed

Updated by Michael Stahnke 4 months ago

  • Description updated (diff)
  • Status changed from Unreviewed to Closed

I don’t think there is a behavior issue here. The cron provider seems to be performing as I would expect. When minute is omitted, * is utilized. That makes sense to me and does not violate principle of least surprise.

Also available in: Atom PDF