Pidfiles should be placed under /run to assure they are recreated every reboot

Bug #1936816 reported by Pedro Guimarães
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Kubernetes Control Plane Charm
Fix Released
Medium
Adam Dyess

Bug Description

Hi,

We are using the lastest charms on a deployment and we've noticed that, after an unexpected restart, auth-webhook service was not being able to start again.

Looking into the code, we can see that pid file is stored on:

https://github.com/charmed-kubernetes/charm-kubernetes-master/blob/637c6079b57c74789880f67c045c46169a9147f9/reactive/kubernetes_master.py#L130

Given that was an abrupt restart, I believe auth-webhook service did not clean the pidfile up; and once it came back, it decide not to start its services because of pre-existing pidfile.

Indeed, by doing:
1) Disable auth-webhook service
2) Remove pidfile
3) Re-enable and restart auth-webhook

We could restart the service successfully.

I recommend that pid files and any other files that should not persist to reboot should be moved to /run instead:
https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s15.html

Revision history for this message
Adam Dyess (addyess) wrote :
Adam Dyess (addyess)
Changed in charm-kubernetes-master:
assignee: nobody → Adam Dyess (addyess)
status: New → In Progress
George Kraft (cynerva)
Changed in charm-kubernetes-master:
importance: Undecided → Medium
status: In Progress → Fix Committed
milestone: none → 1.22+ck3
milestone: 1.22+ck3 → 1.23
George Kraft (cynerva)
Changed in charm-kubernetes-master:
status: Fix Committed → Fix Released
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.