Fix hang on systems with interactive rm

Some systems configure `rm` to prompt when deleting a file as root
user. On such systems, hostmanager hangs when updating the hosts file
since commit 84d2f9e4be ("fix host file management to be windows and
linux compatible").

Avoid this by adding the '-f' parameter to rm.
This commit is contained in:
Simon Baatz 2018-04-17 10:24:20 +02:00
parent ede8b487f3
commit 33e23bffb9
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ module VagrantPlugins
if windir
machine.communicate.sudo("mv -force /tmp/hosts.#{machine.name} #{realhostfile}")
else
machine.communicate.sudo("cat /tmp/hosts.#{machine.name} > #{realhostfile} && rm /tmp/hosts.#{machine.name}")
machine.communicate.sudo("cat /tmp/hosts.#{machine.name} > #{realhostfile} && rm -f /tmp/hosts.#{machine.name}")
end
end