I''m trying to call puppet from a bash script and whilst it works, it causes my script to end prematurely. #!/bin/bash ... function runPuppetLocally() { echo "...running Puppet locally" exec puppet agent --test echo "Puppet complete" } runPuppetLocally I presume Puppet is issuing an exit or something similar which causes my script to end. Is there a means by which I can call it without it terminating my script (I don''t see the "Puppet complete" message)? -- 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 11/30/2011 11:01 AM, Ted wrote:> I''m trying to call puppet from a bash script and whilst it works, it > causes my script to end prematurely. > > #!/bin/bash > > ... > > function runPuppetLocally() > { > echo "...running Puppet locally" > exec puppet agent --test > echo "Puppet complete" > } > runPuppetLocally > > I presume Puppet is issuing an exit or something similar which causes > my script to end. Is there a means by which I can call it without it > terminating my script (I don''t see the "Puppet complete" message)?I don''t think so. "exec" directs bash to use exec(3) to replace itself with a new process image. That''s probably why your script appears to end. -- 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, Dec 1, 2011 at 9:12 PM, Phil Frost <indigo@bitglue.com> wrote:> On 11/30/2011 11:01 AM, Ted wrote: >> >> I''m trying to call puppet from a bash script and whilst it works, it >> causes my script to end prematurely. >> >> #!/bin/bash >> >> ... >> >> function runPuppetLocally() >> { >> echo "...running Puppet locally" >> exec puppet agent --test >> echo "Puppet complete" >> } >> runPuppetLocally >> >> I presume Puppet is issuing an exit or something similar which causes >> my script to end. Is there a means by which I can call it without it >> terminating my script (I don''t see the "Puppet complete" message)? > > I don''t think so. "exec" directs bash to use exec(3) to replace itself with > a new process image. That''s probably why your script appears to end.Just drop the exec and call /usr/bin/puppet <args> directly. -Brian> > -- > 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.