jedi4ever/veewee — pull request #352 by konstan (2012-08-07 14:32:04+00:00)
Title: Explicitly specify full path to (pre)-postinstall scripts on the box being built

Hi,
I had this case with building Win7 box, which uses cygwin's sshd

1. scp (in provider/core/box/build.rb) initiated copy of postinstall.sh file with the path on the box being ./postinstall.sh ie. relative to the login directory; which in case of cygwin is / if the user hasn't started cygwin shell from Windows yet
2 I started cygwin shell that automatically created /home/myusername directory associating it with the home for this user
3. successive exec of "chmod +x ./postinstall.sh" on the box failed not being able to find the file as the file is located in / but this login ended up in /home/myusername.

This happened because there was a considerable delay (15-30 sec) between completion of scp (step 1.) and execution of exec (step 3.) commands when I just clicked on Cygwin icon on Windows desktop. Sorry, I didn't dig into this. This could be either timeouts in the calling code or this could be related to some delays in the ssh port forwarded connection due to my Mac's or VirtualBox configurations.

However, I think, it would be good to always explicitly specify the location of the target remote file so that it can always be found in a predefined place. I set it to /tmp ... but it can be anything else.

Regards,
Konstantin