1

i want to to run the following command with puppet:

sb2-init rasp /home/ubuntu/raspberry_pi_development/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc

In Puppet:

exec { "initSB2":
    command => "sb2-init rasp /home/ubuntu/raspberry_pi_development/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc" ,
    cwd => "/home/vagrant/raspberry_pi_development/rootfs",
    path => "/home/vagrant/raspberry_pi_development/scratchbox2/bin",
    user => 'vagrant',
    logoutput => true,
}

the sb2-init command is in the "/home/vagrant/raspberry_pi_development/scratchbox2/bin" directory and i want to execute this command in the "/home/vagrant/raspberry_pi_development/scratchbox2/bin" Folder.

When i execute this puppet-manifest i get:

    notice: /Stage[main]//Exec[initSB2]/returns: /home/vagrant/raspberry_pi_development/scratchbox2/bin/sb2-init: line 6
sename: command not found
notice: /Stage[main]//Exec[initSB2]/returns: /home/vagrant/raspberry_pi_development/scratchbox2/bin/sb2-init: line 6
sename: command not found
notice: /Stage[main]//Exec[initSB2]/returns: /home/vagrant/raspberry_pi_development/scratchbox2/bin/sb2-init: line 8
sename: command not found
notice: /Stage[main]//Exec[initSB2]/returns: /home/vagrant/raspberry_pi_development/scratchbox2/bin/sb2-init: line 8
 =: unary operator expected
notice: /Stage[main]//Exec[initSB2]/returns: /home/vagrant/raspberry_pi_development/scratchbox2/bin/sb2-init: line 2
readlink: command not found
notice: /Stage[main]//Exec[initSB2]/returns: /home/vagrant/raspberry_pi_development/scratchbox2/bin/sb2-init: line 2
dirname: command not found
notice: /Stage[main]//Exec[initSB2]/returns: /home/vagrant/raspberry_pi_development/scratchbox2/bin/sb2-init: line 2
readlink: command not found
notice: /Stage[main]//Exec[initSB2]/returns: /home/vagrant/raspberry_pi_development/scratchbox2/bin/sb2-init: line 2
/share/scratchbox2/scripts/sb2-parse-sb2-init-args: No such file or directory
notice: /Stage[main]//Exec[initSB2]/returns: Error: no target given
err: /Stage[main]//Exec[initSB2]/returns: change from notrun to 0 failed: /bin/sh -c "sb2-init rasp /home/ubuntu/ras
ry_pi_development/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc" returned 1
ead of one of [0] at /tmp/vagrant-puppet-1/manifests/devbox.pp:332

this command works when i type it manually in the shell but not with puppet!

What is the problem?

Regards Michael

  • i had set the sb2-init path with path => "/home/vagrant/raspberry_pi_development/scratchbox2/bin" – Michael T Jan 29 '14 at 18:21
  • 1
    Ah, I see, I must be blind. You might need /bin/, and /usr/bin in your path as well. In any case, i would probably fire up strace or something to see if you could see what exactly is failing. – Zoredache Jan 29 '14 at 18:28
0

I don't think that this is actually anything to do with Puppet - the command output is actually coming from the script, rather than Puppet (by the looks of it, there are issues with both missing packages and script syntax, but without seeing the script, it's impossible to say).

I would manually run the command (e.g. over SSH) and check the output. Once you have fixed the underlying problem, re-run the Puppet command and everything should succeed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.