Comment 26 for bug 683640

Revision history for this message
Psi-Jack (erenfro) wrote :

Adam,

I looked at the patch #22, and though logically it's "accurate", but it's not at the same time. If the pid file exists but doesn't have the correct information, or any information, pidof should be failed back to check if it literally is running or not directly, not just up and return error code 3 on a whim. This method is prone to failure as-is and doesn't fully fix the problem.

The return of error code 4 for it the pid file exists, but isn't readable due to permissions, that is definitely acceptable because that would more than likely cause a real problem, especially if the process maintains it's own pid file.

Basically this portion should not be there:

+ else
+ return 3 # pidfile specified, but contains no PID to test
+ fi

So it would fall back to normal pidof checking.