Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have this cron for user root (obtained with crontab -l):

20 10,14 * * 1-5 /usr/sbin/puppetd --onetime --no-daemonize --logdest syslog > /dev/null 2>&1

When it is run, it is supposed to update the /var/lib/puppet/state/state.yaml, but it does not, as show the comparison between this:

grep daemonize /var/log/syslog
May 17 10:20:01 frontapp0 CRON[14109]: (root) CMD (/usr/sbin/puppetd --onetime --no-daemonize --logdest syslog > /dev/null 2>&1)

and this:

stat -c %y /var/lib/puppet/state/state.yaml
2013-05-14 11:41:04.980569273 +0200

When the command is run directly from the CLI as root, the file is updated.

Why this difference?

UPDATE Here is what I get in /var/lib/puppet/state/last_run_report.yaml :

--- !ruby/object:Puppet::Transaction::Report
  metrics: {}
  time: 2013-05-24 10:20:03.134275 +02:00
  kind: apply
  host: frontapp0.demo.infra.universcine.com
    - !ruby/object:Puppet::Util::Log
      source: Puppet
      time: 2013-05-24 10:22:06.445975 +02:00
      level: !ruby/sym err
      message: "Could not retrieve catalog from remote server: execution expired"
        - err
    - !ruby/object:Puppet::Util::Log
      source: Puppet
      time: 2013-05-24 10:22:07.513785 +02:00
      level: !ruby/sym notice
      message: "Using cached catalog"
        - notice
    - !ruby/object:Puppet::Util::Log
      source: Puppet
      time: 2013-05-24 10:22:07.514163 +02:00
      level: !ruby/sym err
      message: "Could not retrieve catalog; skipping run"
        - err
  status: failed
  report_format: 3
  resource_statuses: {}
  puppet_version: "2.7.21"

I'm not sure the problem has anything to do with cron anymore.

share|improve this question
Work your way through this serverfault.com/questions/449651/… it will almost certainly help you solve your problem. –  Iain May 17 '13 at 12:07
Very instructive, thanks! I remove the > /dev/null 2>&1, go no mail, but the file was updated... I can't understand why... –  greg0ire May 17 '13 at 12:36
Please don't mark this as a duplicate, cause it is not! Your very good topic inspired me with a workaround, but I still have no clue why this file does not update. This question is still unanswered. –  greg0ire May 17 '13 at 13:46
ping @lain: Do you disagree ? See my update in the question. –  greg0ire May 24 '13 at 11:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.