hi all , i m tring to execute shell script file with puppet. and had logging into machine as non-root . here is my puppet class. class nodeUpdate { exec {"run_process": command => "/usr/local/runprocess.sh", path => ''/usr/bin:/bin:/usr/sbin:/sbin" } } , here "/usr/local/runprocess.sh" shell have some command need to be executed. when i tried to fire puppet as $ sudo puppetd --test --debug , then "/usr/local/runprocess.sh" has some permission issues. some command in this file violate to execute due to permission error. , but i tried to execute this shelll script from terminal..as $ sudo /usr/local/runprocess.sh , then all command in shell file executed sucessfully . what could be the reason? , i didnt get the reason , why permission not granted ? hoping for help!!! regards, Sanjiv Singh -- 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 Dec 14, 2010, at 10:29 PM, sanjiv.singh wrote:> exec {"run_process": > command => "/usr/local/runprocess.sh", > path => ''/usr/bin:/bin:/usr/sbin:/sbin" > }Try putting just this in a file called test.pp. Then try this: puppet --verbose --debug test.pp -- 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.
> Try putting just this in a file called test.pp. Then try this: > puppet --verbose --debug test.ppthanks patrick for quick reply.... i didnt get U, what U tring to say... how this is going to help us by placing code from nodeUpdate.pp class to test.pp class. can U explain in more details.? regards, Sanjiv Singh -- 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 Dec 14, 2010, at 10:57 PM, sanjiv.singh wrote:> > > >> Try putting just this in a file called test.pp. Then try this: >> puppet --verbose --debug test.pp > > thanks patrick for quick reply.... > > i didnt get U, what U tring to say... > how this is going to help us by placing code from nodeUpdate.pp class > to test.pp class. > > can U explain in more details.?Sure. This will remove the puppetmaster and the puppetclient from this problem. That means there is less code it could be going wrong in. -- 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 Dec 15, 12:57 am, "sanjiv.singh" <sanjiv.si...@impetus.co.in> wrote:> > Try putting just this in a file called test.pp. Then try this: > > puppet --verbose --debug test.pp > > thanks patrick for quick reply.... > > i didnt get U, what U tring to say... > how this is going to help us by placing code from nodeUpdate.pp class > to test.pp class. > > can U explain in more details.?You are missing the most important points: the test.pp file goes on the host on which it will be applied, not on the puppetmaster (if that''s different), and you apply it via the "puppet" program instead of via "puppetd". The name of the file has no special significance. John -- 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 Dec 15, 12:29 am, "sanjiv.singh" <sanjiv.si...@impetus.co.in> wrote:> when i tried to fire puppet as > > $ sudo puppetd --test --debug > > , then "/usr/local/runprocess.sh" has some permission issues. > some command in this file violate to execute due to permission error. > > , but i tried to execute this shelll script from terminal..as > > $ sudo /usr/local/runprocess.sh > > , then all command in shell file executed sucessfully . > > what could be the reason? > , i didnt get the reason , why permission not granted ?In all likelihood, the problem is related to the details of the script you are trying to run. Be especially wary of relying on environment variables that your script does not set itself, for Puppet intentionally provides a rather sparse evironment to subprocesses that it execs. Bash does not automatically read system or user shell initialization files when it is started non-interactively (such as when invoked to run a script), but it does inherit environment variables exported by the environment from which it is launched. Therefore, your script has a rather richer environment when launched from an interactive shell than when launched by Puppet. John -- 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.