Sample Header Ad - 728x90

Kill process by fuser instead of pidfile?

0 votes
2 answers
1362 views
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.
Asked by Harald (1030 rep)
Aug 27, 2018, 02:46 PM
Last activity: Aug 27, 2018, 07:36 PM