Tengo un problema que es reproducible en Linux Ubuntu VM (14.04 LTS) creado en Azure.
Después de instalar el systemdpaquete a través del script, el sistema rechaza las nuevas conexiones ssh, infinitamente.
El sistema se está iniciando.
Conexión cerrada por xxx.xxx.xxx.xxx
Sin embargo, la conexión ssh activa se mantiene. No hay ningún /etc/nologinarchivo presente en el sistema.
La única opción que veo es un restablecimiento completo que resuelve el problema. ¿Pero cómo lo evito?
Aquí está el script que estoy usando:
#!/bin/bash
# Script input arguments
user=$1
server=$2
# Tell the shell to quote your variables to be eval-safe!
printf -v user_q '%q' "$user"
printf -v server_q '%q' "$server"
#
SECONDS=0
address="$user_q"@"$server_q"
function run {
ssh "$address" /bin/bash "$@"
}
run << SSHCONNECTION
# Enable autostartup
# systemd is required for the autostartup
sudo dpkg-query -W -f='${Status}' systemd 2>/dev/null | grep -c "ok installed" > /home/$user_q/systemd-check.txt
systemdInstalled=\$(cat /home/$user_q/systemd-check.txt)
if [[ \$systemdInstalled -eq 0 ]]; then
echo "Systemd is not currently installed. Installing..."
# install systemd
sudo apt-get update
sudo apt-get -y install systemd
else
echo "systemd is already installed. Skipping this step."
fi
SSHCONNECTION