4

My shell provisioner is a small bash script that apt-gets a few things, installs a few Perl modules through cpan, sets up Apache and MySQL, echos some text, and exists.

Except that after printing its final message, it seems not to exit, but hangs forever.

Am I forgetting to do something? How can I begin to debug this?

If I use the VirtualBox manager to close the VM, I get a stack trace whose head reads,

/Applications/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/ruby_compat.rb:30:in `select': closed stream (IOError)

Host OS: OS X Snow Leopard Guest OS: Ubunut via precise32

TIA

Lee Goddard
  • 10,680
  • 4
  • 46
  • 63

2 Answers2

4

This is really a comment but I don't have enough reputation to post it as a comment.

I would suggest two techniques to debug this problem.

1) Enable debugging in Vagrant like so:

VAGRANT_LOG=info vagrant up

2) Define set -x at the top of your shell script to link one line of your shell script to the output it creates when run. This should allow you to see which line of your shell script is hanging.

Updating your question with the Vagrantfile will also help us guide you in the right direction.

nikhil
  • 2,471
  • 2
  • 15
  • 12
1

This issue should be resolved in a Vagrant release 1.2.4 or newer, which includes a fix which closes the ssh channel when the shell provisioner exits.

kynan
  • 13,235
  • 6
  • 79
  • 81