Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Shell provisioning fails to exit #1553
Host OS: Win7 x64, Vagrant 1.1.5
Using vagrant provision with shell provisioning, when I start a Java process with threads waiting for input (embedded Jetty server), the ssh session never closes.
The process is started like this: nohup java -cp my.jar my.MainClass arg1 arg2 &
It is then properly started in the background, and the next shell provisioned command executes. Yet, the vagrant provision command never returns.
Workaround: adding pkill ssh at the end of the shell provisioning command list and ignoring the stacktrace.
OK, I found a real solution.
In my case this meant replacing
nohup start.sh &
nohup ./start.sh 0<&- &>/dev/null &
Hope this helps someone else with a similar issue. Not sure if this could be simplified within Vagrant or not. (Autodisconnect of all standard in & outputs?)