That's it! I was getting lazy and not putting the #! /bin/bash at the top of the shell script.
This was a pig to pull out tho': when run under the debugger I flushed out an 'Exec format error', which just didn't make it to the log when run normally. Google found the 'Exec format error' on a unix bash blog as a side comment that 'some scripting languages won't use the shell to run a script unless you're specific in the source file'. Good shout David. Disappointing that I had to learn a/ ruby, b/ the ruby debugger, to pin this down. Do you think that I should record a bug/feature request that all errors get logged? On 19 Sep, 16:58, "David Douthitt" <[email protected]> wrote: > Here's an idea: the first one is probably not run by the shell, as there > is no shell meta-characters in it. The latter three all have shell > meta-characters in them. > > I don't know for certain that puppet does it this way, but it is common > to do things in this manner in scripting languages all over the place. > Is this possible? > > If this is true, then using any shell meta-character (such as > backquotes, wildcards, pipes, or other things) will cause your script to > succeed. > -- > David Douthitt > [email protected] > > On Monday, September 19, 2011 8:52 AM, "Tim Coote" > > > > > > > > <[email protected]> wrote: > > I've clearly not approaching this correctly, so would appreciate some > > advice. > > > I have a trivial shell script to execute. I've whittled this down to a > > one line invocation of true. The file is calledtestand has mode 755 > > > I'm testing with: > > sudo puppetd --debug --test > > > I'm using puppet-0.25.5-2.fc15.noarch on the client and > > puppet-0.25.5-1.fc14.noarch on the server. > > > I have anexeccomponent that looks like this: > > > exec{ "initMysql": > > cwd => "/home/tim/backups", > > path => ["/usr/bin", "/bin"], > > command => "/home/tim/backups/test", # fails > > # command => "/home/tim/backups/test2>&1", # works > > # command => "/home/tim/backups/test> /tmp/wibble", # works > > # command => "/home/tim/backups/test2> /tmp/wibble", # works > > logoutput => true, > > creates => "/home/tim/backups/inited", > > } > > > Failure looks like this: > > > debug: //Node[uranustest]/Exec[initMysql]: Changing returns > > debug: //Node[uranustest]/Exec[initMysql]: 1 change(s) > > debug: //Node[uranustest]/Exec[initMysql]: Executing '/home/tim/ > > backups/test' > > debug: Executing '/home/tim/backups/test' > > err: //Node[uranustest]/Exec[initMysql]/returns: change from notrun to > > 0 failed: /home/tim/backups/testreturned 1 instead of one of [0] at / > > etc/puppet/manifests/nodes.pp:117 > > > An example of success looks like this: > > > debug: //Node[uranustest]/Exec[initMysql]: Changing returns > > debug: //Node[uranustest]/Exec[initMysql]: 1 change(s) > > debug: //Node[uranustest]/Exec[initMysql]: Executing '/home/tim/ > > backups/test2>&1' > > debug: Executing '/home/tim/backups/test2>&1' > > notice: //Node[uranustest]/Exec[initMysql]/returns: executed > > successfully > > > I'm pretty sure that I shouldn't need to redirect the output to get > > the command to work. > > > Any thoughts? > > > Tim > > > -- > > You received this message because you are subscribed to the Google Groups > > "Puppet Users" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
