-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem Description
During package operations (apt-get upgrade, apt-get install, dpkg -i), the system attempts to restart kernel-level components and network services automatically. When connected via SSH, this behavior poses several critical risks:
- SSH Connection Loss: Network service restarts can drop the active SSH connection
- IP Address Changes: DHCP renewal during network restart may assign a different IP
- Server Inaccessibility: Loss of connection combined with IP change can make the server unreachable
- Failed Deployments: Interrupted scripts leave the system in an inconsistent state
This is particularly problematic in automated deployment scripts where losing SSH connectivity means the entire deployment fails mid-execution.
Current Implementation
We're currently using some mitigation strategies, but they're incomplete:
Example 1: apt-get upgrade
if [ "${UPGRADE_APT_PACKAGES}" = true ]; then
echo "[INFO]: Upgrading packages..."
${_SUDO} DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get upgrade -y \
-o Dpkg::Options::="--force-confdef" \
-o Dpkg::Options::="--force-confold" \
-o Acquire::Retries=3 || true
echo "[OK]: Done."
fiExample 2: dpkg -i
echo "[INFO]: Installing 'duf'..."
local _duf_version
_duf_version=$(curl -s https://api.github.com/repos/muesli/duf/releases/latest | grep "tag_name" | cut -d\" -f4 | sed 's/^v//')
rm -fv "duf_${_duf_version}_linux_${_ARCH_DPKG}.deb" || exit 2
wget "https://github.com/muesli/duf/releases/download/v${_duf_version}/duf_${_duf_version}_linux_${_ARCH_DPKG}.deb" || exit 2
${_SUDO} DEBIAN_FRONTEND=noninteractive dpkg -i "duf_${_duf_version}_linux_${_ARCH_DPKG}.deb" || exit 2
rm -fv "duf_${_duf_version}_linux_${_ARCH_DPKG}.deb" || exit 2
echo "[OK]: Done."Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels