This commit adds a variety of fixes for SmartOS guest support:
- Host name setting now works in the global zone and in non-global zones
- NFS now works in the global zone and the non-global zone.
- Tests are updated and moved to the (apparently) more modern style
This commit adds/changes the following for SmartOS guests:
- modifies the "Halt" capability to use /usr/sbin/poweroff in preference
to /usr/sbin/shutdown with parameters, and modifies the associated
test.
- adds an "InsertPublicKey" capability and tests.
- adds a "RemovePublicKey" capability and tests.
With this commit applied, the vast majority of typical Vagrant workflow
is available to SmartOS global zone guests (provided NFS mounts are used
rather than VMWare shared folders).
Before the patch this error will happen if the original directory already exists
-------------------------------------------------------------------------------------------------
==> windows: Rsyncing folder: /vhosts/oxfamshop.com.au/ => /cygdrive/c/inetpub/wwwroot
==> windows: - Exclude: [".vagrant/", ".git/", "target/", "node_modules/"]
==> windows: Showing rsync output...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mkdir '/cygdrive/c/inetpub/wwwroot'
Stdout from the command:
Stderr from the command:
mkdir: cannot create directory ‘/cygdrive/c/inetpub/wwwroot’: File exists
-------------------------------------------------------------------------------------------------
After the patch, this is result
-------------------------------------------------------------------------------------------------
==> windows: Rsyncing folder: /vhosts/oxfamshop.com.au/ => /cygdrive/c/inetpub/wwwroot
==> windows: - Exclude: [".vagrant/", ".git/", "target/", "node_modules/"]
==> windows: Showing rsync output...
==> windows: rsync[stdout] -> sending incremental file list
==> windows: rsync[stdout] ->
==> windows: rsync[stdout] -> sent 500855 bytes received 6635 bytes 78075.38 bytes/sec
==> windows: rsync[stdout] -> total size is 175357552 speedup is 345.54
-------------------------------------------------------------------------------------------------
Reduce the total number of commands run to configure interfaces. If
a service reload/restart is required, only execute it once instead
of once per device. When nm is managing a device, the explicit up
is not required.
Properly detects NetworkManager on guest as well as devices controlled
by NetworkManager. Provides configuration option to enable/disbale
NetworkManager control on devices.
`/etc/init.d/network restart` already restart NM and shutdown interfaces.
In start() :
```
if [ "$(LANG=C nmcli -t --fields running general status 2>/dev/null)" = "running" ]; then
nmcli connection reload
fi
```
In stop() :
```
for i in $vpninterfaces $xdslinterfaces $bridgeinterfaces $vlaninterfaces $remaining; do
unset DEVICE TYPE
(. ./ifcfg-$i
if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
if ! check_device_down $DEVICE; then
action $"Shutting down interface $i: " ./ifdown $i boot
[ $? -ne 0 ] && rc=1
fi
)
done
```
Where $remaining include all "others" interfaces including eth*
This reverts commit 166d10d4e1.
RHEL-7 / Current Fedora versions tend to use NetworkManager for
configuring the networks, and `service network restart` might fail.
If the `NetworkManager` service is running, we should restart it,
otherwise we try restarting `network`.
The `pkg_add` command will return `0` when a package requested for
installation is not found. This adds a validation check to ensure
the rsync package is actually installed on the guest.
When configuring network devices force NetworkManager to reload new
configuration files as they appear. This prevents NetworkManager from
attempting to continue managing devices on initial start up.
/etc/issue is far from being a reliable source for OS detection as it
can be changed by a user without affecting any OS functionality. As
newer Debian systems run systemd by default, check for /etc/os-release
and fallback to lsb_release for older Debian versions. Check #7625 for
a similar issue. Even lsb_release is not manatory, therefore keep the
current code of parsing /etc/issue to avoid regressions.
Add failing networking interface list sorting test with example
provided by #7883. Update sorting logic to properly handle different
types and differing array lengths.
Fixes#7883