Questions tagged [kill]

kill - Send a specified signal to a process or process group.

Questions about the kill shell utility and the kill(2) function on which it is based, which send a signal to a process or a process group.

684 questions
7
votes
3 answers

Why won't this process die after SIGTERM

I have a process which appears to be hung. When I try and reboot the process, I get a timeout. service logstash_server stop timeout: run: logstash_server: (pid 11797) 839061s, want down, got TERM I have tried running a tail -f on the logs, which…
spuder
  • 18,053
2
votes
1 answer

kill all process of executables in a folder

I need to kill all the child process. The main process in lmbench pkill -9 lmbench is not killing it, but kill -9 kills the parent process, but even after killing the parent process some process from /usr/lib/lmbebch/bin keeps running,…
limovala
  • 764
2
votes
2 answers

How to safely kill processes so that output redirection is not aborted?

I'm writing some automation scripts, in which I need to kill some processes. Previously I would usually use kill -9 pid to kill processes but once upon a time, I notice that when I used kill -9 to kill some tcpdump processes: For example: tcpdump -i…
misteryes
  • 1,333
2
votes
1 answer

killall for this terminal only

When debugging I often use killall to kill a process. This is really a bad habit because there might be more processes running of the same name on the system. Normally the process I want to kill is a descendant from the same parent (or grandparent)…
Ole Tange
  • 35,514
2
votes
3 answers

What is a non-agressive way of killing a process?

I want to close a program through the command line (say Firefox or Thunderbird). The program is working just fine and in theory I could just go FILE > CLOSE. However, I want to do this through the command line so that is not an option. I could kill…
user32421
  • 337
  • 5
  • 10
2
votes
1 answer

How long has GNU kill(1) accepted a name argument?

We recently discovered that GNU kill, going beyond spec, will take a name as its argument and try to kill all processes with that name, in the same vein as pkill(1) or some implementations of killall. I haven't been able to find GNU's changelog for…
kojiro
  • 4,644
2
votes
1 answer

Why kill -9 -1 doesn't work?

From man kill: kill -9 -1       Kill all processes you can kill. But when I do sudo /bin/kill -9 -1 nothing happens. My uname -a for info: Linux michal-Q530 3.16.0-45-generic #60~14.04.1-Ubuntu SMP Fri Jul 24 21:16:23 UTC 2015 x86_64 x86_64 x86_64…
MichalH
  • 2,379
2
votes
1 answer

Guard against killing an already killed process

I'm writing a script that tries to kill a process. But the process might already been killed by others. How can I guard against it and prevent this kill command from terminating my process with throwing an error? I have PID of the process
Mohsen
  • 2,585
1
vote
1 answer

How do I kill a process and ensure that port bindings are cleaned up?

I have a situation where I kill a process, but when restarting it, I get the Address already in use error. I am running sudo netstat -lntp to get the process ID, which returns, for example: tcp 0 0 0.0.0.0:8002 0.0.0.0:* …
1
vote
1 answer

SIGUSR2 question

I am CentOS 7.4 on Dell servers. Running this command in a script: kill -SIGUSR2 `ps -ef|grep ${rule}/etc/suricata/suricata.yaml|grep -v grep|awk '{ print $2 }'` The "ps" part here grabs PID. What does SIGUSR2 do here? I see it's "user-defined";…
1
vote
2 answers

can't kill a process running on server

I ran a R console on our server, and the process took much longer time than I expected. Thus I was trying close it by ctrl+z, it didn't work. Finally I just closed the terminal. But the process is still there when I check with top commands. I used…
1
vote
1 answer

A higher level of sudo killing a PID

When I ps aux | grep 'S' I see a few programs that I want to kill. According to man ps the state code for S is interruptible sleep (waiting for an event to complete). I've tried kill [Process ID (PID)] and also sudo kill [Process ID (PID)]. Despite…
3kstc
  • 4,706
0
votes
2 answers

KILL process with input as process name and time

I am trying to write a shell script to kill a specified process if it runs more than specified time and get process information before killing. Note: Script should take process name and time as input. What I have tried so far is as below: …
ravi
  • 1
0
votes
0 answers

Unable to kill process with kill -KILL

I am miffed... This should work. I am using AWS and inside of a docker image but I would still expect this to work: root@1e896e1e9c8e:~/shipamax/server# pgrep -d " " -f ^chromedriver 924 root@1e896e1e9c8e:~/shipamax/server# sudo kill -KILL…