NRPE race-condition caused by "chown" ran at update_nrpe_config and nrpe charm
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Kubernetes Worker Charm |
Incomplete
|
Undecided
|
Unassigned | ||
NRPE Charm |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
Hi,
Running latest stable charms.
Some of nrpe checks on kubernetes-worker fail with:
Unable to run kubectl and parse output
That is caused whenever /var/lib/nagios is owned by root instead of nagios user.
That is a clear race condition between nrpe and worker charms.
On worker code, I can see:
https:/
Where worker sets owner of the folder as nagios.
On nrpe charm, however, I see the folder is set for root:
2020-11-27 12:07:56 INFO juju-log Making dir /usr/local/
2020-11-27 12:07:56 INFO juju-log Making dir /var/lib/
Therefore, some units may end up with root owner as well. That will depend on which hook is ran before.
This is also confirmed on stat command:
https:/
Where failing units have root as owner.
Changed in charm-kubernetes-worker: | |
status: | New → Incomplete |
tags: | added: seg sts |
Changed in charm-nrpe: | |
importance: | Undecided → Medium |
Also adding NRPE charm, since it should be setting proper permissions on /var/lib/nagios as part of install hook.