Comment 28 for bug 683640

Revision history for this message
Adam Conrad (adconrad) wrote :

Psi-Jack, you're misreading LSB, and also not considering daemons that can change their names on exec, etc. If we specify a pidfile, that's ALL we should be checking. 0, 1, 3, and 4 are clearly defined returns for this:

0: we have a file, it has a PID, the daemon is running.
1: the file exists, has a PID, but the daemon is dead.
3: the daemon isn't running.
4: we can't determine how we can tell you what's going on (and the case of an unreadable file fits here)

I see no reason why it would need to be a regular file, and this is the exact check we perform earlier, but inverted.

At any rate, I suspect the place we disagree is on your "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", and we'll just have to agree to disagree there. If you specify a pidfile, that's what should be checked, period. Falling back to pidof means we're looking for OTHER processes that have nothing to do with the pidfile referenced (chroots, processes started by other users, there are tons of reasons for /bin/foo to be running on a system but not be YOUR /bin/foo).