controllers.yaml permission change from user to root when using "sudo juju status" or juju under sosreport
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Low
|
Unassigned |
Bug Description
When invoking "juju status" with sudo, the permissions are changed from the user, to root (uid=0) on ~/.local/
The particular use case this causes problems, is when using "sosreport" which calls juju status (and perhaps other commands) as part of it's information gathering. This causes future juju commands as the actual user to fail, since the file changed ownership.
As a simple fix, perhaps the permissions on existing files shouldn't be changed. However there is probably deeper thought to be had about this use case.
Additional to this, I noticed there is a persistent juju lock file created in /tmp (e.g. juju-store-
summary: |
controllers.yaml permission change from user to root when using "sudo - juju status" + juju status" or juju under sosreport |
This will be due to the way we update the controllers file atomically, but writing a new temp file and moving into place. We should look into this a bit deeper.