mkdir /usr/local/sbin before writing autologin wrapper

Alpine's base image doesn't create /usr/local/sbin, so the heredoc
failed with "can't create /usr/local/sbin/autologin-root: nonexistent
directory" on fresh containers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
d4nn13andClaude Opus 4.7 committed 2026-04-19 19:45:13 +02:00
1 parent 78c3a790be
commit 4cb36b7807
1 file changed
+1 -1
+1 -1
View File
@@ -161,7 +161,7 @@ pct exec "$VMID" -- sh -c "curl -fsSL '$BOOTSTRAP_URL' \
# is unchanged in practice — anyone who can open the web console already has # is unchanged in practice — anyone who can open the web console already has
# `pct enter` on the host. # `pct enter` on the host.
log "enabling tty1 auto-login" log "enabling tty1 auto-login"
pct exec "$VMID" -- sh -c 'cat > /usr/local/sbin/autologin-root && chmod 0755 /usr/local/sbin/autologin-root' <<'AUTOLOGIN' pct exec "$VMID" -- sh -c 'mkdir -p /usr/local/sbin && cat > /usr/local/sbin/autologin-root && chmod 0755 /usr/local/sbin/autologin-root' <<'AUTOLOGIN'
#!/bin/sh #!/bin/sh
exec /bin/login -f root exec /bin/login -f root
AUTOLOGIN AUTOLOGIN