mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 02:54:26 +00:00
0d8ed0ba8 bounded these call sites with one ceiling for both operations. The two are not equally safe to cut. A SIGTERM landing mid-postinst leaves dpkg interrupted, and in docker_dataroot.sh that fails every later filesystem candidate and sends the run through decline() - one truncated package install becomes a dead job. An interrupted update has no such cascade; it just repeats. Measured on ubuntu:latest with the exact commands: update 10s, install zfsutils-linux 20s. 1200s is a 60x margin on the operation that carries the cascade, and update keeps the 600s it cannot plausibly need more than. This breaks the single-number invariant with scripts/install/apt.sh:19, which is already broken in fact - that call site carries a different Acquire option set than these three do. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
22 lines
874 B
Bash
Executable File
22 lines
874 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
if command -v pacman >/dev/null 2>&1; then
|
|
pacman -Sy --noconfirm --needed docker bind fuse-overlayfs
|
|
elif command -v apt-get >/dev/null 2>&1; then
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
APT_TIMEOUT=10m
|
|
APT_INSTALL_TIMEOUT=20m
|
|
APT_OPTS=(-o Acquire::Retries=5 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30)
|
|
timeout -k 30 "${APT_TIMEOUT}" apt-get "${APT_OPTS[@]}" update
|
|
timeout -k 30 "${APT_INSTALL_TIMEOUT}" apt-get "${APT_OPTS[@]}" install -y --no-install-recommends docker-ce containerd.io dnsutils fuse-overlayfs
|
|
elif command -v dnf >/dev/null 2>&1; then
|
|
dnf -y install docker-ce containerd.io bind-utils fuse-overlayfs
|
|
elif command -v yum >/dev/null 2>&1; then
|
|
yum -y install docker-ce containerd.io bind-utils fuse-overlayfs
|
|
else
|
|
echo "no supported package manager for docker daemon install" >&2
|
|
exit 1
|
|
fi
|