curtin in-target sudo copy command fails and crashes installer

Bug #2014999 reported by Jan-Philipp Jürgens
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subiquity
New
Undecided
Unassigned
curtin (Ubuntu)
New
Undecided
Unassigned

Bug Description

full command in cloud-inits user-data late-commands section:
curtin in-target -- sudo cp /cdrom/cargo/posinst-temp /target/etc/sudoers.d/

ubuntu 22.04.2 lts
21.3-0ubuntu1 curtin

I expected file to be copied

File wasn't copied.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: curtin (not installed)
Uname: Linux 5.15.0-67-generic x86_64
Architecture: amd64
Date: Sun Apr 2 14:01:44 2023
ProcEnviron:
 LANG=C.UTF-8
 TERM=linux
 PATH=(custom, no user)
SourcePackage: curtin

description: updated
Revision history for this message
Dan Bungert (dbungert) wrote :

Fixing the Affects components, should not be a cloud-init issue.

Changed in cloud-init:
status: New → Invalid
Revision history for this message
Jan-Philipp Jürgens (seemax1991) wrote :

@dbungert Sorry, assumed as this took place while using cloud-init with curtin and therefore should be linked as well. I will try not to repeat such mistakes in the future.

Revision history for this message
Dan Bungert (dbungert) wrote :

@Jan-Philipp - no problem at all! :)

Also, I think I see the problem. 'curtin in-target' is functionally a chroot, and /cdrom is not mounted there. I think you want this instead:

cp /cdrom/cargo/posinst-temp /target/etc/sudoers.d/

Would you confirm?

Revision history for this message
Jan-Philipp Jürgens (seemax1991) wrote :

So basically the late.commands example would be:
- curtin in-target -- sudo something something
- sudo cp /cdrom/cargo/posinst-temp /target/etc/sudoers.d/ (sudo because /etc/ is root protected afaik? As in no permissions to cp/edit stuff there if not by sudo/root)
- curtin in-target -- sudo something something
etc...
?

Revision history for this message
Jan-Philipp Jürgens (seemax1991) wrote :

If that is the case this doc (https://ubuntu.com/server/docs/install/autoinstall-reference#late-commands) should maybe be changed to clarify that not every command needs to be run via curtin. Reading that I assumed curtin is a given necessity.

no longer affects: cloud-init
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.