Fixes #10170: Check for modinfo in /sbin
This commit is contained in:
parent
f30b136c57
commit
a742476305
|
@ -93,7 +93,7 @@ module VagrantPlugins
|
|||
"systemctl --no-pager --no-legend --plain list-unit-files --all --type=service " \
|
||||
"| grep #{nfs_service_name_systemd}").exit_code == 0
|
||||
else
|
||||
Vagrant::Util::Subprocess.execute("modinfo", "nfsd").exit_code == 0 ||
|
||||
Vagrant::Util::Subprocess.execute(modinfo_path, "nfsd").exit_code == 0 ||
|
||||
Vagrant::Util::Subprocess.execute("grep", "nfsd", "/proc/filesystems").exit_code == 0
|
||||
end
|
||||
end
|
||||
|
@ -261,6 +261,17 @@ module VagrantPlugins
|
|||
Vagrant::Util::Subprocess.execute(*Shellwords.split(check_command)).exit_code == 0
|
||||
end
|
||||
|
||||
def self.modinfo_path
|
||||
path = Vagrant::Util::Which.which("modinfo")
|
||||
return path if path
|
||||
|
||||
folders = ["/sbin"]
|
||||
folders.each do |folder|
|
||||
path = "#{folder}/modinfo"
|
||||
return path if File.file?(path)
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
# Reset the cached values for capability. This is not considered a public
|
||||
# API and should only be used for testing.
|
||||
|
|
Loading…
Reference in New Issue