Recently I developed the habit of killing processes with
fuser -k -n tcp $PORT
which can hardly kill the wrong process. I prefer this over fiddling with a pidfile that may or may not be still there or may or may not contain the correct pid (OK, I am a bit dramatic here :-)
Yet the typical stop script I stumble over still uses a pidfile.
Am I missing an important feature of the pidfile approach or a misfeature of the fuser approach
. My best guess is that fuser
is not available. Though judging by search engine results, bsd, debian, suse, centos, aix, solaris all seem to have it.