I found that getPID() and checkPID() functions does not work as expected. checkPID() does not remove PID file if PID file exists but it is empty. So I have tried to fix it.
How did you implement it:
1) Added extra check to getPID() function. It is not necessary, but it makes source code more readable and clear.
2) Fixed if-condition: force remove PID file with empty PID even if it does not exists. Otherwise we should check if running process is a Unicorn process.
How can we verify it:
1) Run Anicorn with Unicorn
2) Truncate PID file.
3) Restart Anicorn.
After these steps we should be able to run Anicorn with deleted PID file.
Is this ready for review?: Yes
Is it a breaking change?: No
What did you implement:
I found that
getPID()
andcheckPID()
functions does not work as expected.checkPID()
does not remove PID file if PID file exists but it is empty. So I have tried to fix it.How did you implement it:
1) Added extra check to
getPID()
function. It is not necessary, but it makes source code more readable and clear. 2) Fixed if-condition: force remove PID file with empty PID even if it does not exists. Otherwise we should check if running process is a Unicorn process.How can we verify it:
1) Run Anicorn with Unicorn 2) Truncate PID file. 3) Restart Anicorn.
After these steps we should be able to run Anicorn with deleted PID file.
Is this ready for review?: Yes Is it a breaking change?: No