Skip to content

Instantly share code, notes, and snippets.

@dcarley
Created October 18, 2011 08:38
Show Gist options
  • Save dcarley/1294929 to your computer and use it in GitHub Desktop.
Save dcarley/1294929 to your computer and use it in GitHub Desktop.
Puppet config_version requires shebang
dan@dan-MacPro:~$ echo '/bin/date' > /tmp/version
dan@dan-MacPro:~$ chmod +x /tmp/version
dan@dan-MacPro:~$ /tmp/version
Tue Oct 18 09:22:49 BST 2011
dan@dan-MacPro:~$ puppet apply -v --config_version /tmp/version -e 'notice("foobar")'
Unable to set config_version: Execution of '/tmp/version' returned 1: on node dan-macpro.xxx.com
dan@dan-MacPro:~$ echo -e '#!/bin/bash\n/bin/date' > /tmp/version
dan@dan-MacPro:~$ puppet apply -v --config_version /tmp/version -e 'notice("foobar")'
notice: Scope(Class[main]): foobar
info: Applying configuration version 'Tue Oct 18 09:23:04 BST 2011'
@dcarley
Copy link
Author

dcarley commented Oct 18, 2011

09:23 < whack> ruby's kernel.exec is buggy
09:24 < whack> https://gist.github.com/1294896
09:26 < whack> or not, shells are just more clever
09:26 < whack> looks like shells call execve() and when that returns ENOEXEC it tries to run it as shell
09:27 < whack> https://gist.github.com/1294902

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment