Sha256: 97a71c8d81e9b4e77fa31f4bc726b20e14a2e6ad0da19dda7d5e5be86247a43d
Contents?: true
Size: 643 Bytes
Versions: 12
Compression:
Stored size: 643 Bytes
Contents
require 'vagrant/util/guest_inspection' module VagrantPlugins module GuestLinux module Cap class Halt extend Vagrant::Util::GuestInspection::Linux def self.halt(machine) begin if systemd?(machine.communicate) machine.communicate.sudo("systemctl poweroff") else machine.communicate.sudo("shutdown -h now") end rescue IOError, Vagrant::Errors::SSHDisconnected # Do nothing, because it probably means the machine shut down # and SSH connection was lost. end end end end end end
Version data entries
12 entries across 12 versions & 3 rubygems