From 7406096b79763ed0b326d549c24c4e1346015ce0 Mon Sep 17 00:00:00 2001 From: d4nn13 Date: Thu, 23 Apr 2026 19:30:24 +0200 Subject: [PATCH] fix autologin: use empty-id inittab line so it survives cold restart Co-Authored-By: Claude Opus 4.7 --- proxmox/create-lxc.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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