Write daemon PID to /var/run/{progName} on Linux
Opened this issue · 0 comments
aaronpburke commented
I'm noticing inconsistent behavior between Linux distributions.
On Ubuntu/Debian, using the same (standard) SysVinit script, "service {name} stop" does not function as intended. The daemon is never killed during a stop() command. After much debugging, I've found that adding the final PID to /var/run{progName} corrects the stop() behavior.
On RedHat/CentOS, everything works as expected.
Of course, this likely comes down to differences in fallback mechanisms between the two distributions when the .pid file isn't present, but having a .pid file would go a long way to ensuring compatibility across Linux distributions.