Commit 14a0990
committed
Skip user creation on reboot when user already exists
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>1 parent aea9a53 commit 14a0990
1 file changed
Lines changed: 18 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 85 | | |
100 | 86 | | |
101 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| |||
0 commit comments