- nfs.service got recently removed in openSUSE Tumbleweed and calling service
restart nfs errors out on Tumbleweed. nfs.service has been an alias to
nfs-client.target for a very long time and can thus be safely substituted.
- all actively supported versions of openSUSE & SLE are using systemd now
=> no reason not to use systemctl
Prior to this commit, the BSD options for the /etc/exports file was not
properly set up in the correct order for a given entry. It was however
fixed for FreeBSD, but never for the original exports template. This
commit fixes that by unifying the BSD and FreeBSD templates.
When a large number of shares are defined it may cause the generated
command to exceed the maximum allowed length. To prevent this, only
allow 10 shares to be processed at a time.
Fixes#10483
Since we are no longer extracting information based on key value due
to localization issues, use start and end locations to extract data.
This prevents errors when extra information is included like Scope.
Only move new exports file to destination without sudo when the
file has write access and the directory has write access. Always
use sudo when changing file ownership.
Service status check was failing because it was not being run as root. This resulted in vagrant thinking the service was not running, hence it would always try to start nfs rather than updating exports.
Adds the final line of output to tests and properly simulates
failure. Fix with type casting to prevent calling methods on
nil and drop the final entry as it's not valid.
Fixes#9806
Provides simple nfs service name detection via systemd or sys-v. Defaults
are provided if no match is found. Service name is defined via method
allowing derivative guests to only need to provide an updated name.
Prior to this commit, if you set up multiple folders to export with NFS
on linux with the exact same hostpath, the template used to write
/etc/exports would end up placing the same path with the same IP in
/etc/exports and cause an error preventing the folders from being
properly mounted. This commit fixes that by first looking at which
folders are being exported and if there are any duplicates. If so,
remove the duplicates and only export 1 hostpath folder. If these
duplicate folders have differing nfs linux options, an exception must be
thrown because we cannot assume which options the user intended to
export with.