On 8/23/10 9:15 AM, Franck wrote:
So I've decided to use crontab for all my puppet clients rather than the daemon. I've set-up a puppetmaster with seven puppet clients.I'm using the following pattern: class cron { $minute = generate('/usr/bin/env', 'sh', '-c', 'printf $((RANDOM %60+0))') cron { "manual-puppet": command => "/usr/sbin/puppetd --server=ps-dev-web1 --logdest=/ var/log/puppet/puppet.log --verbose --onetime --no-daemonize", user => "root", hour => "*", minute => $minute, ensure => present, } }
Have you considered using the --splay & --splaylimit options built into puppet rather than constantly editing the crontab?
http://docs.puppetlabs.com/references/stable/configuration.html?action=diff&version=41#splay
Six of the puppet clients are running the cronjob just fine at random intervals, except one. The thing about this host is that if I run the crontab entry command manually, it's successful: [r...@ps-dev-app1 puppet]# /usr/sbin/puppetd --server=ps-dev-web1 -- logdest=/var/log/puppet/puppet.log --verbose --onetime --no-daemonize info: Caching catalog for ps-dev-app1.plansourcedev.com info: Applying configuration version '1282328744' notice: /Stage[main]/Cron/Cron[manual-puppet]/minute: minute changed '5' to '31' notice: /Stage[main]/Cron/Cron[manual-puppet]/hour: defined 'hour' as '*' notice: Finished catalog run in 0.39 seconds However, when I run this through crontab, nothing happens. Here's what the /var/log/cron shows, when it executes the command through crontab: Aug 23 16:01:01 ps-dev-app1 crond[16367]: (root) CMD (/usr/sbin/ puppetd --server=ps-dev-web1 --logdest=/var/log/puppet/puppet.log -- verbose --debug --onetime --no-daemonize)
And although the command seems to execute through crontab, there's no evidence of this otherwise. For one, the "/var/log/puppet.log" does not get created or append to existing log. The crontab entry should also reflect a change in interval time, but there's no evidence of this either.
Maybe just a typo, but the command you are running shows the puppet.log should be created in /var/log/puppet/puppet.log but you are looking in /var/log/puppet.log. Perhaps there is a permission issue or /var/log/puppet/ does not exist?
I've tried several different things, including removing the crontab file - "crontab -r" and re-running the command manually to re-create the crontab entry. I've, verified, my crond is running normally, by running random commands and verifying they executed through cron. It would seem only "puppetd" is not success at running through crontab. Fortunately, only one of my puppet clients is experiencing this issue. Anyone have an idea of what could be perpetuating this behavior ? Thanks.
-- You received this message because you are subscribed to the Google Groups "Puppet Users" 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-users?hl=en.
