Configurable solaris 'suexec' command, fix shared folder mount
This commit is contained in:
parent
29e640e211
commit
0e0bc33137
|
@ -13,10 +13,13 @@ module Vagrant
|
||||||
|
|
||||||
attr_accessor :halt_timeout
|
attr_accessor :halt_timeout
|
||||||
attr_accessor :halt_check_interval
|
attr_accessor :halt_check_interval
|
||||||
|
# This sets the command to use to execute items as a superuser. sudo is default
|
||||||
|
attr_accessor :suexec_cmd
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@halt_timeout = 30
|
@halt_timeout = 30
|
||||||
@halt_check_interval = 1
|
@halt_check_interval = 1
|
||||||
|
@suexec_cmd = 'sudo'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -33,7 +36,7 @@ module Vagrant
|
||||||
def halt
|
def halt
|
||||||
vm.env.ui.info I18n.t("vagrant.systems.solaris.attempting_halt")
|
vm.env.ui.info I18n.t("vagrant.systems.solaris.attempting_halt")
|
||||||
vm.ssh.execute do |ssh|
|
vm.ssh.execute do |ssh|
|
||||||
ssh.exec!("pfexec poweroff")
|
ssh.exec!("#{vm.env.config.solaris.suexec_cmd} /usr/sbin/poweroff")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Wait until the VM's state is actually powered off. If this doesn't
|
# Wait until the VM's state is actually powered off. If this doesn't
|
||||||
|
@ -49,10 +52,10 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
def mount_shared_folder(ssh, name, guestpath)
|
def mount_shared_folder(ssh, name, guestpath)
|
||||||
ssh.exec!("pfexec mkdir -p #{guestpath}")
|
ssh.exec!("#{vm.env.config.solaris.suexec_cmd} mkdir -p #{guestpath}")
|
||||||
# Using a custom mount method here; could use improvement.
|
# Using a custom mount method here; could use improvement.
|
||||||
ssh.exec!("pfexec mount -F vboxfs v-root #{guestpath}")
|
ssh.exec!("#{vm.env.config.solaris.suexec_cmd} /sbin/mount -F vboxfs #{name} #{guestpath}")
|
||||||
ssh.exec!("pfexec chown #{vm.env.config.ssh.username} #{guestpath}")
|
ssh.exec!("#{vm.env.config.solaris.suexec_cmd} chown #{vm.env.config.ssh.username} #{guestpath}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue