Ubuntu Server 20.04.3 autoinstall - User not available until reboot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
subiquity |
New
|
Undecided
|
Unassigned | ||
subiquity (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
As per documentation:
- late-commands
-- Shell commands to run after the install has completed successfully and any updates and packages installed, just before the system reboots.
Doesn’t seem to be the case. At least during late-commands I would expect the system to be finished as per description, but i.e. the defined user in identity isn’t even in `/target/
The specified user(s) in the `identity` or `user-data` section is/are not applied until the final reboot happens. Therefore, late-command is not being run in a complete state of the install!
How to check? Watch both passwd or group until the installer finishes. Nothing happens there. On reboot everything is suddenly there.
This prevents my late-command scripts to fail, `in-target target=/target`, i.e. `su: user USER does not exist`.
Manually adding users in late-command using `useradd` causes this user to be id 1000 and every other following counted up. Furthermore those users added by the installer are not being able to login then because their home directory belongs to `root:root`.
Yes, this is how it works, the user is created by cloud-init on first boot. If you need to run commands as that user, it might make sense to also run those commands at first boot via user-data?