Sumith Sudhakaran | 20 May 05:58 2011
Picon

[Puppet Users] Not able to execute shell script

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 <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Denmat | 20 May 09:30 2011
Picon

Re: [Puppet Users] Not able to execute shell script

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 <at> 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 <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe <at> 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 <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Sumith Sudhakaran | 20 May 10:32 2011
Picon

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 <at> 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 <at> 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 <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe <at> 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 <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe <at> 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 <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Sumith Sudhakaran | 20 May 10:36 2011
Picon

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 <at> 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 <at> 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 <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe <at> 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 <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe <at> 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 <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Felix Frank | 31 May 14:05 2011
Picon

Re: [Puppet Users] Not able to execute shell script

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 <at> gmail.com
> <mailto:tu2bgone <at> 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 <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

jcbollinger | 20 May 14:52 2011

[Puppet Users] Re: Not able to execute shell script


On May 19, 10:58 pm, Sumith Sudhakaran <sumit... <at> 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 <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Peter Bukowinski | 20 May 07:59 2011
Picon

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
> 
> Sumith 

Can 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 <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.


Gmane