diff --git a/proxmox/create-lxc.sh b/proxmox/create-lxc.sh index bacc9f7..5cf24d3 100755 --- a/proxmox/create-lxc.sh +++ b/proxmox/create-lxc.sh @@ -167,11 +167,12 @@ exec /bin/login -f root AUTOLOGIN pct exec "$VMID" -- sh -c ' - # Drop ANY existing getty line for tty1 (Alpine LXC inittab uses an empty - # id field: "::respawn:/sbin/getty 38400 tty1"), then add the auto-login - # variant with an explicit id so our line wins on any future re-run. + # Alpine LXC inittab uses an empty id field: "::respawn:/sbin/getty 38400 tty1". + # A non-empty id makes busybox init try to open /dev/ as the controlling + # tty before exec — which fails on cold lxc-start and respawn-throttles the + # line into silent-disabled. Keep the empty-id form so we survive reboots. sed -i -E "/getty.*tty1$/d" /etc/inittab - echo "tty1::respawn:/sbin/getty -n -l /usr/local/sbin/autologin-root 38400 tty1" >> /etc/inittab + echo "::respawn:/sbin/getty -n -l /usr/local/sbin/autologin-root 38400 tty1" >> /etc/inittab # Reload init and kick any running getty so it respawns from the new config. kill -HUP 1 2>/dev/null || true pkill -KILL getty 2>/dev/null || true