The host's clean shutdown next to reboot_host: /sbin/poweroff as root,
detached and two seconds late like the restart, so the exit status comes
back before the session drops. A refusal raises RuntimeError with what
the host said, plus the sudo password hint where sudo wanted one.
poweroff rather than shutdown -h now: systemd links it to systemctl
poweroff, sysvinit and BusyBox ship it themselves, while BusyBox has no
shutdown and sysvinit's -h may only halt.
LinuxProcessReadingsMixin carries napalm-device-types' ServicesRestartMixin:
its command goes through the driver's sudo like the listening sockets, and
there is no unprivileged retry, since a reading of the login user's own
processes would read as clean.
Without a root login and without a sudo password, _run_privileged typed
"sudo -n <command>" into the interactive shell. sudo covered only the
first simple command of the line, and dnf's and yum's advisory query,
which starts with a brace group, did not parse at all: no status marker
ever arrived, so netmiko waited out the 120 s read timeout and
get_available_updates() failed. This is the default path for netOrk's
own NOPASSWD account.
The command now goes to "sudo -n sh -c" as one argument, as _as_root
already does with a password. A status echo at its end stays outside
sh -c: it reports sh's status, which is the command's, and still
arrives when sudo refuses.
Closes#56