fix: use getty auto-login instead of systemd TTY service for first-boot setup

Replaces kiosk-firstboot.service (which got SIGHUP'd by getty) with a
simpler approach: configure getty@tty1 to auto-login root, run kiosk-setup
from .bash_profile. Cleaner TTY ownership — no service/getty conflicts.
install-kiosk.sh now removes the auto-login config and kiosk-setup script
on completion so root doesn't auto-login after the kiosk is running.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 23:36:42 +00:00
parent d3b05f981f
commit 165e77b9b8
2 changed files with 23 additions and 26 deletions
+5 -1
View File
@@ -146,9 +146,13 @@ chown -R "$KIOSK_USER:$KIOSK_USER" \
"$HOME_DIR" \ "$HOME_DIR" \
"$CHROMIUM_PROFILE" "$CHROMIUM_PROFILE"
# ── Enable LightDM, remove first-boot service ───────────────────── # ── Enable LightDM, remove first-boot setup ───────────────────────
systemctl enable lightdm systemctl enable lightdm
systemctl set-default graphical.target systemctl set-default graphical.target
# Remove auto-login and setup script so root doesn't auto-login after kiosk is running
rm -f /etc/systemd/system/getty@tty1.service.d/autologin.conf
rm -f /usr/local/bin/kiosk-setup
# Legacy cleanup (no-op if not present)
systemctl disable kiosk-firstboot 2>/dev/null || true systemctl disable kiosk-firstboot 2>/dev/null || true
rm -f /etc/systemd/system/kiosk-firstboot.service rm -f /etc/systemd/system/kiosk-firstboot.service
systemctl daemon-reload systemctl daemon-reload
+18 -25
View File
@@ -2,9 +2,8 @@
set -e set -e
# Downloaded and run by the preseed late_command after Debian base install. # Downloaded and run by the preseed late_command after Debian base install.
# Fetches install-kiosk.sh and installs it as a first-boot setup service. # Fetches install-kiosk.sh, configures getty@tty1 to auto-login as root,
# The service runs interactively on the first reboot, prompts for name/username, # and runs the setup wizard automatically on first reboot.
# then installs the kiosk and reboots into kiosk mode.
REPO_BASE="https://gitea.jgitta.com/jgitta/senior-kiosk/raw/branch/master" REPO_BASE="https://gitea.jgitta.com/jgitta/senior-kiosk/raw/branch/master"
@@ -12,30 +11,24 @@ echo "==> SeniorNet: downloading setup script..."
curl -fsSL "$REPO_BASE/install-kiosk.sh" -o /usr/local/bin/kiosk-setup curl -fsSL "$REPO_BASE/install-kiosk.sh" -o /usr/local/bin/kiosk-setup
chmod +x /usr/local/bin/kiosk-setup chmod +x /usr/local/bin/kiosk-setup
echo "==> SeniorNet: installing first-boot service..." echo "==> SeniorNet: configuring auto-login on TTY1..."
cat > /etc/systemd/system/kiosk-firstboot.service << 'EOF' mkdir -p /etc/systemd/system/getty@tty1.service.d
[Unit] cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << 'EOF'
Description=SeniorNet Kiosk First-Boot Setup
After=network-online.target
Wants=network-online.target
Conflicts=getty@tty1.service
After=getty@tty1.service
[Service] [Service]
Type=oneshot ExecStart=
ExecStart=/usr/local/bin/kiosk-setup ExecStart=-/sbin/agetty --autologin root --noclear %I $TERM
StandardInput=tty
TTYPath=/dev/tty1
TTYReset=yes
IgnoreSIGPIPE=no
RemainAfterExit=no
[Install]
WantedBy=multi-user.target
EOF EOF
systemctl enable kiosk-firstboot echo "==> SeniorNet: configuring setup to run on first login..."
# Boot to text mode for the first-boot wizard, then kiosk setup switches to graphical cat >> /root/.bash_profile << 'EOF'
# SeniorNet first-boot setup — runs once then removes itself
if [ -x /usr/local/bin/kiosk-setup ]; then
/usr/local/bin/kiosk-setup
fi
EOF
# Boot to text mode for the setup wizard
systemctl set-default multi-user.target systemctl set-default multi-user.target
echo "==> SeniorNet: ready. First-boot setup will run on next reboot." echo "==> SeniorNet: ready. Setup wizard will run automatically on next reboot."