Linux – Why can’t I kill a `Sl` process

killlinuxprocess

On Lubuntu 18.04, I open pcmanfm

$ pcmanfm . 

and after looking at the thumbnails of the image files under the current directory in pcmanfm, I closed the window of pcmanfm by Alt-F4, but it is still hanging on the foreground in the terminal emulator.

I move it to background by Ctrl-Z and bg 2, and kill it, but doesn't work.

$ jobs -l 
[2]+ 31124 Running                 pcmanfm . &
$ kill %2
$ jobs -l
[2]+ 31124 Running                 pcmanfm . &
$ sudo kill 31124
$ jobs -l
[2]+ 31124 Running                 pcmanfm . &

Its state is Sl, S means "interruptible sleep (waiting for an event to complete)" and l means "is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)". So I wonder why I can't kill the process? How would you kill it? Thanks.

$ ps aux | grep [3]1124
t        31124  0.8  0.7 693952 57064 pts/9    Sl   06:34   0:47 pcmanfm 

.

Best Answer

By default, kill only sends a TERM signal, for some reason pcmanfm is ignoring this signal. If you pass option -KILL to kill, then it will send the signal to the scheduler, and the process will be removed with no chance to clean-up, or appeal.

You do not need extra privileges (sudo), to kill processes that you own. sudo can be dangerous, don't just use out of frustration.

Related Question