# Installed by the custom ISO (iso/build-iso.sh) and enabled from its # autoinstall late-commands. Runs install.sh once, on tty1, the first # time the freshly installed system boots - ordered before getty@tty1, # so the login prompt only appears on tty1 once this has finished and # an interactive install has the keyboard and screen to itself. /var/lib/kiosk-firstboot/pending is removed once the install # finishes, so this is a no-op on every boot after that; an interrupted # or failed install leaves it in place and simply runs again next boot. # # Ordering, learned the hard way on 26.04: # - NOT After=cloud-final.service: cloud-final is After=multi-user.target, # and multi-user.target (which wants this unit) is After= it - an # ordering cycle, which systemd "fixes" at boot by dropping a job: this # one, so the install silently never ran. (The script doesn't wait for # cloud-init either, for the same reason - it would deadlock.) # - NOT Conflicts=getty@tty1: getty.target pulls getty@tty1 into the same # boot transaction, and systemd resolves a conflict between two wanted # jobs by dropping one. Before= alone is enough - getty@tty1 waits for # this oneshot to finish. [Unit] Description=Ubuntu Based Kiosk first-boot install After=network-online.target systemd-user-sessions.service plymouth-quit-wait.service Wants=network-online.target Before=getty@tty1.service ConditionPathExists=/var/lib/kiosk-firstboot/pending [Service] Type=oneshot ExecStart=/usr/local/sbin/kiosk-firstboot # Belt and braces for the temporary sudoers/apt drop-ins when install.sh # reboots out from under the script (its own EXIT trap normally does this). ExecStopPost=/usr/local/sbin/kiosk-firstboot --cleanup StandardInput=tty-force StandardOutput=tty StandardError=tty TTYPath=/dev/tty1 TTYReset=yes TTYVHangup=yes TimeoutStartSec=infinity TimeoutStopSec=30 KillMode=mixed [Install] WantedBy=multi-user.target