mitchellh/vagrant — Issue #627: Feature/Detect OpenBSD when issuing shutdown/reboot commands
Author: stefancocora
Created: 2012-01-07 22:43:47+00:00
State: open

Detect OpenBSD when issuing shutdown/reload commands.
The below finding are on latest OpenBSD 5.0 amd64

I have seen these situations :
- vagrant halt
- vagrant package ...
- vagrant reload also fails on OpenBSD

Shutdown:
OpenBSD doesn't shutdown when you issue halt or shutdown -h now. It just shows a message to press any key to reboot.
[OpenBSD halt screenshot](http://imagebin.org/192387)
[OpenBSD shutdown -h now screenshot](http://imagebin.org/192389)
To properly halt it you need to issue halt -p

Reload:
OpenBSD does reboot when issued with shutdown -r now, but vagrant reload fails with the below stack trace and the OpenBSD box is left in the "Press any key to reboot" state
[vagrant reload screenshot](http://imagebin.org/192388)

```
stefan@thoth:~/download/truecrypt1/Docs/vagrant/openbsd$ vagrant reload
[default] Attempting graceful shutdown of linux...
/usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:33:in `select': closed stream (IOError)
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:33:in `io_select'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:32:in `synchronize'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:32:in `io_select'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/transport/packet_stream.rb:73:in `available_for_read?'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/transport/packet_stream.rb:85:in `next_packet'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/transport/session.rb:169:in `poll_message'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/transport/session.rb:164:in `loop'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/transport/session.rb:164:in `poll_message'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/connection/session.rb:451:in `dispatch_incoming_packets'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/connection/session.rb:213:in `preprocess'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/connection/session.rb:197:in `process'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/connection/session.rb:161:in `loop'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/connection/session.rb:161:in `loop_forever'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/connection/session.rb:161:in `loop'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/connection/channel.rb:269:in `wait'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/ssh/session.rb:72:in `exec!'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/util/retryable.rb:14:in `retryable'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/ssh/session.rb:64:in `exec!'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/systems/linux.rb:26:in `halt'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/ssh.rb:119:in `execute'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/systems/linux.rb:25:in `halt'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/action/vm/halt.rb:12:in `call'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/action/warden.rb:30:in `call'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/action/vm/discard_state.rb:17:in `call'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/action/warden.rb:30:in `call'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/action/builder.rb:120:in `call'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/action.rb:134:in `run'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/util/busy.rb:19:in `busy'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/action.rb:134:in `run'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/environment.rb:364:in `lock'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/environment.rb:354:in `open'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/environment.rb:354:in `lock'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/action.rb:133:in `run'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/vm.rb:154:in `reload'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/command/reload.rb:9:in `execute'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/command/reload.rb:7:in `each'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/command/reload.rb:7:in `execute'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:22:in `send'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/config.rb:115:in `map'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/core_ext/ordered_hash.rb:73:in `each'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:109:in `send'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:109:in `invoke'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/lib/vagrant/cli.rb:45:in `reload'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:22:in `send'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
from /usr/lib/ruby/gems/1.8/gems/vagrant-0.8.2/bin/vagrant:21
from /usr/bin/vagrant:19:in `load'
from /usr/bin/vagrant:19
stefan@thoth:~/download/truecrypt1/Docs/vagrant/openbsd$ ```