Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Make MAINPID= and PIDFile= handling more restrictive (and other stuff) #7816
referenced this pull request
Jan 5, 2018
Isn't there a race condition in the checks? Suppose I am forking a new main process (with a new configuration). The old one stays around for cleanup purpose (waiting for old connections to terminate). It signals the new main process with
If there was a way for systemd to acknowledge the MAINPID change somehow, this would fix the problem (old main process would pause new main process until the acknowledgment).
We probably should add proper dbus APIs for the various things you can do with sd_notify(), and that would be naturally synchronous, and could return error. However, I wonder if it would be as attractive to people, given that D-Bus isn't universally loved still...
In the scenario you describe things wouldn't be too bad, after all things would eventually recover. But of course that could be delayed arbitrarily long...