Hi, After configuring puppet ( 2.6.8 ) in RHEL 5 update 6, I am able to execute commands individually but I am not able execute the shell script, its giving error only. Somebody please help me how can I execute a shell script in rhel5 update6 using puppetserver. hereunder I am mentioning the manifests format, which i have followed *exec { "start": command => "/usr/bin/start.sh", logoutput => true, }* Error I am getting:- err: /Stage[main]//Exec[start]/ returns: change from notrun to 0 failed: /usr/bin/start returned 1 instead of one of [0] at /etc/puppet/manifests/site.pp:7 *I am able to execute this script directly. * -- * Regards*** * Sumith** * -- 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.
Peter Bukowinski
2011-May-20 05:59 UTC
Re: [Puppet Users] Not able to execute shell script
On Thursday, May 19, 2011 at 11:58 PM, Sumith Sudhakaran wrote: Hi,> > After configuring puppet ( 2.6.8 ) in RHEL 5 update 6, I am able to execute commands individually but I am not able execute the shell script, its giving error only. Somebody please help me how can I execute a shell script in rhel5 update6 using puppetserver. hereunder I am mentioning the manifests format, which i have followed > > exec { "start": > command => "/usr/bin/start.sh", > logoutput => true, > } > > Error I am getting:- > > err: /Stage[main]//Exec[start]/ > returns: change from notrun to 0 failed: /usr/bin/start returned 1 instead of one of [0] at /etc/puppet/manifests/site.pp:7 > > > I am able to execute this script directly. > > -- > Regards > > SumithCan you provide the content of start.sh? Failing that, when you run the script directly, does it exit with code 0? To test, run ''/usr/bin/start.sh; echo $?'' -- Peter M. Bukowinski Systems Engineer Janelia Farm Research Campus, HHMI -- 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.
Hi, What is the exit code of the script when you run manually? Does it exit with 1? Cheers, Den On 20/05/2011, at 13:58, Sumith Sudhakaran <sumithtm@gmail.com> wrote:> Hi, > > After configuring puppet ( 2.6.8 ) in RHEL 5 update 6, I am able to execute commands individually but I am not able execute the shell script, its giving error only. Somebody please help me how can I execute a shell script in rhel5 update6 using puppetserver. hereunder I am mentioning the manifests format, which i have followed > > exec { "start": > command => "/usr/bin/start.sh", > logoutput => true, > } > > Error I am getting:- > > err: /Stage[main]//Exec[start]/ > returns: change from notrun to 0 failed: /usr/bin/start returned 1 instead of one of [0] at /etc/puppet/manifests/site.pp:7 > > > I am able to execute this script directly. > > -- > Regards > > Sumith > > -- > 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.-- 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.
Sumith Sudhakaran
2011-May-20 08:32 UTC
Re: [Puppet Users] Not able to execute shell script
Thanks for your replay No, I just create a shell for testing with following content. chmod 777 /root/testfile Nothing else . On Fri, May 20, 2011 at 1:00 PM, Denmat <tu2bgone@gmail.com> wrote:> Hi, > > What is the exit code of the script when you run manually? Does it exit > with 1? > > Cheers, > Den > > > On 20/05/2011, at 13:58, Sumith Sudhakaran <sumithtm@gmail.com> wrote: > > Hi, > > After configuring puppet ( 2.6.8 ) in RHEL 5 update 6, I am able to > execute commands individually but I am not able execute the shell script, > its giving error only. Somebody please help me how can I execute a shell > script in rhel5 update6 using puppetserver. hereunder I am mentioning the > manifests format, which i have followed > > *exec { "start": > command => "/usr/bin/start.sh", > logoutput => true, > }* > > Error I am getting:- > > err: /Stage[main]//Exec[start]/ > returns: change from notrun to 0 failed: /usr/bin/start returned 1 instead > of one of [0] at /etc/puppet/manifests/site.pp:7 > > > *I am able to execute this script directly. * > > -- > * Regards*** > > * Sumith** * > > -- > 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. > > -- > 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. >-- * Regards*** * Sumith** * -- 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.
Sumith Sudhakaran
2011-May-20 08:36 UTC
Re: [Puppet Users] Not able to execute shell script
Thanks for your reply No, I just create a shell for testing with following content. chmod 777 /root/testfile Nothing else. On Fri, May 20, 2011 at 1:00 PM, Denmat <tu2bgone@gmail.com> wrote:> Hi, > > What is the exit code of the script when you run manually? Does it exit > with 1? > > Cheers, > Den > > > On 20/05/2011, at 13:58, Sumith Sudhakaran <sumithtm@gmail.com> wrote: > > Hi, > > After configuring puppet ( 2.6.8 ) in RHEL 5 update 6, I am able to > execute commands individually but I am not able execute the shell script, > its giving error only. Somebody please help me how can I execute a shell > script in rhel5 update6 using puppetserver. hereunder I am mentioning the > manifests format, which i have followed > > *exec { "start": > command => "/usr/bin/start.sh", > logoutput => true, > }* > > Error I am getting:- > > err: /Stage[main]//Exec[start]/ > returns: change from notrun to 0 failed: /usr/bin/start returned 1 instead > of one of [0] at /etc/puppet/manifests/site.pp:7 > > > *I am able to execute this script directly. * > > -- > * Regards*** > > * Sumith** * > > -- > 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. > > -- > 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. >-- * Regards*** * Sumith** * -- 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 May 19, 10:58 pm, Sumith Sudhakaran <sumit...@gmail.com> wrote:> Hi, > > After configuring puppet ( 2.6.8 ) in RHEL 5 update 6, I am able to > execute commands individually but I am not able execute the shell script, > its giving error only. Somebody please help me how can I execute a shell > script in rhel5 update6 using puppetserver. hereunder I am mentioning the > manifests format, which i have followed > > *exec { "start": > command => "/usr/bin/start.sh", > logoutput => true, > > }* > > Error I am getting:- > > err: /Stage[main]//Exec[start]/ > returns: change from notrun to 0 failed: /usr/bin/start returned 1 instead > of one of [0] at /etc/puppet/manifests/site.pp:7 > > *I am able to execute this script directly. *And Puppet was able to execute it too (but see also below); that''s how it found that the exit status was 1. Puppet expects scripts to follow the Unix convention of exiting with status 0 when they are successful. Any other exit status indicates a failure of some kind. When a command executed by a Puppet Exec exits with an error status, the Exec fails. I observe also, however, that the error message you report does not appear to exactly match your Exec resource: the error message claims to have run /usr/bin/start, whereas the exec gives the command as /usr/ bin/start.sh. These are not equivalent, so I''m not sure what''s going on here. 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.
If that is the whole content of you "shell script" it''s missing the shebang line. """ #!/bin/sh chmod 777 /root/testfile """ You''re still missing a PATH variable, so this script is still a mess. You should write a proper test script. HTH, Felix On 05/20/2011 10:36 AM, Sumith Sudhakaran wrote:> Thanks for your reply > > No, I just create a shell for testing with following content. > > chmod 777 /root/testfile > > Nothing else. > > > On Fri, May 20, 2011 at 1:00 PM, Denmat <tu2bgone@gmail.com > <mailto:tu2bgone@gmail.com>> wrote: > > Hi, > > What is the exit code of the script when you run manually? Does it > exit with 1? > > Cheers, > Den >-- 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.