Skip to content

Skip user creation on reboot when user already exists#10

Merged
jandubois merged 1 commit intorancher-sandbox:mainfrom
jandubois:fix-useradd-on-reboot
Mar 12, 2026
Merged

Skip user creation on reboot when user already exists#10
jandubois merged 1 commit intorancher-sandbox:mainfrom
jandubois:fix-useradd-on-reboot

Conversation

@jandubois
Copy link
Member

useradd fails on the second boot because the user persists from the first boot. This causes rd-init to exit before configuring networking, which blocks systemd-networkd, lima-init, and sshd from starting.

Check whether the user exists before calling useradd. The rest of the setup (authorized_keys, sudoers) still runs on every boot.

On persistent disk images (qcow2/raw), useradd fails on the second
boot because the user persists from the first boot. This causes
rd-init to exit before configuring networking, which blocks
systemd-networkd, lima-init, and sshd from starting.

Check whether the user exists before calling useradd. The rest of
the setup (authorized_keys, sudoers) still runs on every boot.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
@jandubois jandubois merged commit 0fcf666 into rancher-sandbox:main Mar 12, 2026
8 of 9 checks passed
@jandubois jandubois deleted the fix-useradd-on-reboot branch March 12, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants