Merge ~kissiel/plainbox-provider-checkbox:fix-verify-lxd into plainbox-provider-checkbox:master

Proposed by Maciej Kisielewski
Status: Rejected
Rejected by: Maciej Kisielewski
Proposed branch: ~kissiel/plainbox-provider-checkbox:fix-verify-lxd
Merge into: plainbox-provider-checkbox:master
Diff against target: 12 lines (+1/-0)
1 file modified
units/virtualization/jobs.pxu (+1/-0)
Reviewer Review Type Date Requested Status
Maciej Kisielewski Disapprove
Jonathan Cave (community) Approve
Review via email: mp+389153@code.launchpad.net

Description of the change

make verify_lxd job run as root

Some systems may not be preconfigured to run lxd as an unprivileged user, so this MR should help with running the job on those systems.

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

I guess this is ok - feels like in some situations it would be a requirement to *not* be root though. I sounds like you have a real use-case so +1

review: Approve
Revision history for this message
Jeff Lane  (bladernr) wrote :

Was this actually a failing issue on devices? IIRC LXD is designed to run by non-privileged users by default. Simply installing LXD and running lxd-init as a normal user should be sufficient. Running it as root shouldn't be necessary at all.

One gotcha we DID discover though is that if you do a sosreport BEFORE you run the LXD tests, you'll find the LXD tests won't work, because sosreport runs as root, and can trigger some LXD stuff, changing the ownership of some of the files to root, making it impossible at that point for a non-privileged user to run lxc commands.

This was fixed on our sosreport jobs by adding '-n lxd' to the sosreport command line to tell it to skip any LXD stuff.

Revision history for this message
Maciej Kisielewski (kissiel) wrote :

Yeah, I tested Jeff's hypothesis and yeah, it was my knee-jerk reaction to just add this. If the problem arises in the future I'll dig deeper.

review: Disapprove

Unmerged commits

63ae6a2... by Maciej Kisielewski

virtualization: run verify_lxd as root

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/units/virtualization/jobs.pxu b/units/virtualization/jobs.pxu
2index 9471031..ac8f2c7 100644
3--- a/units/virtualization/jobs.pxu
4+++ b/units/virtualization/jobs.pxu
5@@ -20,6 +20,7 @@ category_id: com.canonical.plainbox::virtualization
6 id: virtualization/verify_lxd
7 environ: LXD_TEMPLATE LXD_ROOTFS
8 estimated_duration: 30.0
9+user: root
10 requires:
11 executable.name == 'lxc'
12 package.name == 'lxd' or snap.name == 'lxd'

Subscribers

People subscribed via source and target branches