mitchellh/vagrant-installers — pull request #36 by benesch (2014-05-19 18:23:19+00:00)
Title: substrate: exec vagrant to eliminate bash launch wrapper

The Bash script that wraps Vagrant is badly behaved and eats certain signals.
Launch Vagrant with `exec` to replace the Bash wrapper and allow signals to be
handled directly by Vagrant.

Consider the following:

```bash
$ vagrant rsync-auto &
$ kill -INT $!
```

`$!` returns the PID of the Bash wrapper script, not the Ruby process running
Vagrant. By default, Bash will ignore interrupts while running a command, so
Bash will swallow the signal generated by `kill -INT $!`, even though Vagrant
would exit had it received the signal.

You don't see this behavior on Ctrl-c, since Ctrl-c sends an interrupt to all
processes in the foreground process group—i.e., both Bash and Ruby.

(`kill -TERM $!` will successfully terminate the processes, but only after
printing an insuppressible "Terminated: 15" message.)