Set the home directory to /root when using sudo
Encountered this issue while using puppet. Created configuration file /root/.my.cnf but mysql was looking for /home/vagrant/.my.cnf Passing -H to sudo causes sudo to set env HOME=/root/
This commit is contained in:
parent
2d9d16d6e1
commit
33538d2900
|
@ -34,7 +34,7 @@ module Vagrant
|
|||
# of `sudo`.
|
||||
def sudo!(commands, options=nil, &block)
|
||||
channel = session.open_channel do |ch|
|
||||
ch.exec("sudo #{env.config.ssh.sudo_shell} -l") do |ch2, success|
|
||||
ch.exec("sudo -H #{env.config.ssh.sudo_shell} -l") do |ch2, success|
|
||||
# Set the terminal
|
||||
ch2.send_data "export TERM=vt100\n"
|
||||
|
||||
|
|
Loading…
Reference in New Issue