Hi all, I moved my clients'' daemon to a cron using: http://reductivelabs.com/trac/puppet/wiki/Recipes/cron My first attempt: # /usr/bin/ruby /usr/sbin/puppetd --server=gridinstall.pic.es --test err: Could not retrieve catalog: Failed to execute generator /usr/bin/env: Execution of ''/usr/bin/env /usr/local/sbin/randomnum td006.pic.es 60'' returned 127: /usr/bin/env: /usr/local/sbin/randomnum: No such file or directory at /etc/puppet/manifests/modules/local_conf/manifests/init.pp:71 on node td006.pic.es but: # ls -lsa /usr/local/sbin/randomnum 4 -rwxr-xr-x 1 root root 679 Mar 16 12:48 /usr/local/sbin/randomnum I removed /usr/bin/env and now I get: err: Could not retrieve catalog: Failed to execute generator /usr/local/sbin/randomnum: Execution of ''/usr/local/sbin/randomnum td006.pic.es 60'' returned 1: at /etc/puppet/manifests/modules/local_conf/manifests/init.pp:72 on node td006.pic.es but if I run it by hand: # /usr/local/sbin/randomnum td006.pic.es 60 58[root@td006 ~]# echo $? 0 Here I paste code: $timeoffset1 = generate(''/usr/local/sbin/randomnum'', "$fqdn", "60") cron { "puppet": ensure => present, command => "/usr/sbin/puppetd --onetime --no-daemonize --logdest /var/log/puppet/puppet.log --server gridinstall.pic.es > /dev/null 2>&1", user => ''root'', minute => [$timeoffset1], } Could someone explainme why randomnum is returning 1 when it runs insiede puppet? TIA, Arnau --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Arnau Bria wrote:> err: Could not retrieve catalog: Failed to execute generator > /usr/local/sbin/randomnum: Execution of ''/usr/local/sbin/randomnum > td006.pic.es 60'' returned 1: at > /etc/puppet/manifests/modules/local_conf/manifests/init.pp:72 on node > td006.pic.es > > but if I run it by hand: > > # /usr/local/sbin/randomnum td006.pic.es 60 58[root@td006 ~]# echo $? > 0 > > Could someone explainme why randomnum is returning 1 when it runs > insiede puppet?If randomnum is a shell script, perhaps a missing PATH entry in it, or some other difference between puppet''s PATH and root''s? -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, 17 Mar 2009 08:28:00 -0500 Mike Renfro wrote: Hi Mike,> If randomnum is a shell script, perhaps a missing PATH entry in it, or > some other difference between puppet''s PATH and root''s?It''s perl. Original recipe has something like: generate(''/usr/bin/env'', ''/etc/puppet/modules/puppet/bin/randomnum'', "$fqdn", "30") But if I add env in front of I get an awful error (pasted in OP). I don''t know how to see script''s output after puppet executing it... Thanks, Arnau --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 17, 2009, at 3:47 AM, Arnau Bria wrote:> > Hi all, > > I moved my clients'' daemon to a cron using: > http://reductivelabs.com/trac/puppet/wiki/Recipes/cron > > My first attempt: > # /usr/bin/ruby /usr/sbin/puppetd --server=gridinstall.pic.es --test > err: Could not retrieve catalog: Failed to execute generator /usr/ > bin/env: Execution of ''/usr/bin/env /usr/local/sbin/randomnum > td006.pic.es 60'' returned 127: /usr/bin/env: /usr/local/sbin/ > randomnum: No such file or directory > at /etc/puppet/manifests/modules/local_conf/manifests/init.pp:71 on > node td006.pic.es > > but: > # ls -lsa /usr/local/sbin/randomnum > 4 -rwxr-xr-x 1 root root 679 Mar 16 12:48 /usr/local/sbin/randomnum > > I removed /usr/bin/env and now I get: > > err: Could not retrieve catalog: Failed to execute generator /usr/ > local/sbin/randomnum: Execution of ''/usr/local/sbin/randomnum > td006.pic.es 60'' returned 1: at /etc/puppet/manifests/modules/ > local_conf/manifests/init.pp:72 on node td006.pic.es > > but if I run it by hand: > > # /usr/local/sbin/randomnum td006.pic.es 60 > 58[root@td006 ~]# echo $? > 0 > > > Here I paste code: > $timeoffset1 = generate(''/usr/local/sbin/randomnum'', "$fqdn", "60") > > cron { "puppet": > ensure => present, > command => "/usr/sbin/puppetd --onetime --no- > daemonize --logdest /var/log/puppet/puppet.log --server > gridinstall.pic.es > /dev/null 2>&1", > user => ''root'', > minute => [$timeoffset1], > } > > > Could someone explainme why randomnum is returning 1 when it runs > insiede puppet?Is randomnum on your client or server? It needs to be on your server. -- A complex system that works is invariably found to have evolved from a simple system that works. -- John Gaule --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, 19 Mar 2009 17:10:41 -0500 Luke Kanies wrote:> > Could someone explainme why randomnum is returning 1 when it runs > > insiede puppet? > > Is randomnum on your client or server? > > It needs to be on your server.That''s the problem :-) thnaks for your reply. Cheers, Arnau --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---