Which is what happens when you have every daemon writing their own PID handling code, running as root, in a language whose interpolation rules nobody really understands.
It is quite possible to have the script for PID handling be written once, and imported as needed.
It is quite possible to have the script for PID handling be written once, and imported as needed.