Method: Vagrant::Guest::Solaris#halt

Defined in:
lib/vagrant/guest/solaris.rb

#haltObject

There should be an exception raised if the line

vagrant::::profiles=Primary Administrator

does not exist in /etc/user_attr. TODO



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/vagrant/guest/solaris.rb', line 64

def halt
  # Wait until the VM's state is actually powered off. If this doesn't
  # occur within a reasonable amount of time (15 seconds by default),
  # then simply return and allow Vagrant to kill the machine.
  count = 0
  last_error = nil
  while vm.state != :poweroff
    begin
      vm.channel.execute("#{vm.config.solaris.suexec_cmd} /usr/sbin/poweroff")
    rescue IOError => e
      # Save the last error; if it's not shutdown in a reasonable amount
      # of attempts we will re-raise the error so it's not hidden for
      # all time
      last_error = e
    end

    count += 1
    if count >= vm.config.solaris.halt_timeout
      # Check for last error and re-raise it
      if last_error != nil
        raise last_error
      else
        # Otherwise, just return
        return
      end
    end

    # Still opportunities remaining; sleep and loop
    sleep vm.config.solaris.halt_check_interval
  end # while
end