essentialkaos / anicorn

Simple utility for starting/restarting Unicorn
https://kaos.sh/anicorn
Apache License 2.0
1 stars 0 forks source link

Fix getting PID from empty PID file #22

Closed gongled closed 6 years ago

gongled commented 6 years ago

What did you implement:

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

andyone commented 6 years ago

Thanks!