Closed kniteli closed 9 months ago
Feel free to send a PR and request my review.
I don't think that changing the StateDirectory to be different for each service is the proper fix. What worked for me is changing the RuntimeDirectory to be "kea" for all the Kea services. I also set RuntimeDirectoryPreserve=true so that systemd doesn't delete the runtime directory if only one service restarts.
@jcollie That sounds like a better approach. Will send a PR in a minute.
Suspected cause and symptom
See here for a recent change which pointed kea to separate lockfiles for the various individual services.
https://github.com/NixOS/nixpkgs/blob/85f1ba3e51676fa8cc604a3d863d729026a6b8eb/nixos/modules/services/networking/kea.nix#L331-L334
It results in this symptom in logs and no logging from kea:
I did some investigating and can verify the following:
/proc/<PID>/environs
confirms the process was started with the env variable in place./var/lib/kea
currently, which is where it is actually looking according to the logs. This implies the value of that environment variable is null at the time a lock is attempted.I spent some time looking for the root cause but nothing stood out to me and I'm not familiar with the idiosyncrasies of systemd. Simple workaround is to just override the StateDirectory to match the new change. My approach to that: