1
vote
3answers
134 views

kill script execution

I have a script that I have to run with certain frequency. This script executes a number of programs, in a loop, setting some variables in each loop. Since this script runs for hours, I run it using ...
2
votes
1answer
258 views

When I kill a subprocess created in a bash script - it automatically re-spawns. Why?

I have the following script which I run using the command: ./thescript.sh 2>&1 & and if I kill the sub process spawned by it, after a few seconds it is restarted. Why is this? ...
0
votes
1answer
328 views

Why kill makes a bash script exit

after the kill statement the script prints "Terminated" and the following lines never get executed: #!/bin/bash kill -9 `ps -ef | grep MailSender | grep -v grep | awk '{print $2}'` echo starting ...
3
votes
1answer
264 views

Kill process group not working

I'm on Debian GNU/Linux. The man page for "kill" says I can use negative PID value to kill process group, but when running on command line, it does not work: $ /bin/kill -9 -21581 /bin/kill: invalid ...
3
votes
3answers
908 views

When will kill PID fail?

I'm trying to kill 31216 31617,but after 10 times,that process still survives. Why? Is there a way to force it dead? root 31216 1 0 10:49 ? 00:00:00 nginx: master process ...
6
votes
3answers
10k views

kill a screen (but not all screens)

I have multiple screens running on an Ubuntu server that are initiated as: screen -dmS screen1 cmd screen -dmS screen2 cmd etc... And I need to kill one screen, but not all of them. What is the ...
2
votes
4answers
637 views

How can I prevent users using kill in bash?

I've tried chmod 700 /bin/kill chown root /bin/kill but a normal user can still do: kill blah ... and successfully kill the app 'blah' running under the user's account. I'm using Ubuntu (8.10). ...
0
votes
5answers
425 views

Way to kill frozen application

I have an application that freezes. I can't terminate it with ^C, so I have to do following: $ ./myapp ^C^Z [1]+ Stopped ./myapp $ pgrep -lf myapp 18479 bash ./myapp $ kill -9 18479 ...
4
votes
5answers
2k views

Bash snippet for killing a process until it's dead?

I'm trying to write a robust bash script, and in it I create a background process. At the end of the script, I want to kill it. I have it's PID. I was thinking of somthing like this while [[ ps ef ...
5
votes
2answers
3k views

linux: kill all my processes but not this terminal

I want an easy way in linux to kill all my current processes. The problem with kill -9 -1 is that it also kills the current terminal. Is there an easy way to kill everything except the current ...