jedi4ever / veewee

Easing the building of vagrant boxes
MIT License
4.29k stars 779 forks source link

ubuntu ./postinstall.sh .veewee_params: not found #1030

Open mikes-spindance opened 9 years ago

mikes-spindance commented 9 years ago

I'm running veewee 360e48f38ed8d05162b024f3393f75f244056ba6 on OS X.

commands:

bundle exec veewee vbox define awesome-ubuntu-server ubuntu-12.10-server-i386 --force
bundle exec veewee vbox build 'awesome-ubuntu-server' --force

It fails:

2015-02-11 20:15:42 -0500 -  - [veewee] About to execute remote command echo 'vagrant'|sudo -S sh './postinstall.sh' on box awesome-ubuntu-server - 127.0.0.1 - {:user=>"vagrant", :port=>"7222", :password=>"vagrant", :timeout=>10000, :keys=>[]}
2015-02-11 20:15:42 -0500 - ui - [veewee] Executing command: echo 'vagrant'|sudo -S sh './postinstall.sh'
Executing command: echo 'vagrant'|sudo -S sh './postinstall.sh'
2015-02-11 20:15:42 -0500 - ui - [veewee] [sudo] password for vagrant: 
[sudo] password for vagrant: 2015-02-11 20:15:42 -0500 - ui - [veewee] ./postinstall.sh: 5: .: 
./postinstall.sh: 5: .: 2015-02-11 20:15:42 -0500 - ui - [veewee] .veewee_params: not found
.veewee_params: not found2015-02-11 20:15:42 -0500 - ui - [veewee] 

2015-02-11 20:15:42 -0500 - ui - [veewee] ERROR: exit code 2
ERROR: exit code 2
2015-02-11 20:15:42 -0500 - ui - [veewee] Error executing command echo 'vagrant'|sudo -S sh './postinstall.sh' : Exitcode was not what we expected
Error executing command echo 'vagrant'|sudo -S sh './postinstall.sh' : Exitcode was not what we expected
2015-02-11 20:15:42 -0500 - ui - [veewee] Exitcode was not what we expected
Exitcode was not what we expected
tomato:veewee mikes$ 

I've trace the problem to https://github.com/jedi4ever/veewee/blob/360e48f38ed8d05162b024f3393f75f244056ba6/templates/ubuntu-12.10-server-i386/postinstall.sh#L5

Where we end up running dash even though postinstall.sh shebangs bash, and the $SHELL reports bash. See http://askubuntu.com/questions/97522/how-can-my-script-determine-whether-its-being-run-by-bash-or-dash

I've debug the problem to confirm that we end up running dash and if we change

  . .veewee_params

to

  . ./.veewee_params

It works.

But I don't understand why I seem to be the only person having this problem.

I recommend changing all instances of . .veewee_params to . ./.veewee_params.

I deleted the pull request suggestion. It seems that I started from the wrong branch to start using veewee.

I tried to go towards the tip of the tree because I wanted parallels support, but maybe that is too close to the tip of the tree.

jeanmichel-gh commented 9 years ago

You are not alone ... I am seeing the exact same error and am grateful you documented the issue along with a fix. Thank you.

mpapis commented 9 years ago

open a pull request please, this can not break anything and if it helps you it's not a problem to add it