Monday, April 29, 2024
264
rated 0 times [  264] [ 0]  / answers: 1 / hits: 467926  / 1 Year ago, mon, may 1, 2023, 8:55:12

I am trying to improve my command line skills and I have encountered a problem where I cannot kill a process. I type kill 2200 where 2200 is my PID and the process is not killed. After few minutes wait is still in the top and ps aux.
I have even tried typing it with sudo - no results.



Any ideas why it would be like that ?






EDIT



I have found a weird dependency, where fg updates the processes list:



x@xxx:/etc/grub.d$ ps
PID TTY TIME CMD
1723 pts/0 00:00:00 bash
2200 pts/0 00:00:00 top
2202 pts/0 00:00:00 top
2258 pts/0 00:00:00 ps
x@xxx:/etc/grub.d$ fg
top

x@xxx:/etc/grub.d$ ps
PID TTY TIME CMD
1723 pts/0 00:00:00 bash
2200 pts/0 00:00:00 top
2620 pts/0 00:00:00 ps
x@xxx:/etc/grub.d$ fg
top

x@xxx:/etc/grub.d$ ps
PID TTY TIME CMD
1723 pts/0 00:00:00 bash
2621 pts/0 00:00:00 ps

More From » command-line

 Answers
2

Processes can ignore some signals. If you send SIGKILL it will not be able to ignore it (and neither catch it to do cleanups). Try:



kill -9 {PID}


Learn more by reading the manual page:



man kill

[#43627] Wednesday, May 3, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tersle

Total Points: 342
Total Questions: 109
Total Answers: 99

Location: Kazakhstan
Member since Mon, Sep 26, 2022
2 Years ago
;