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

learn more… | top users | synonyms

27
votes
2answers
2k views

What does `kill -0` do?

I recently came across this in a shell script. if ! kill -0 $(cat /path/to/file.pid); then ... do something ... fi What does kill -0 ... do?
0
votes
1answer
17 views

Logging of what ended a process?

Due to the tight resources of the server, I suspect System will end processes from time to time. I want those events to be logged in a separate file for investigation. How do I set that in ...
0
votes
1answer
49 views

How does kill cascade in Linux? [duplicate]

Let us say I have process A which spawns process B, which spawns process C. Under what circumstances will killing A kill the whole chain (or tree I guess) and when will it not? I sometimes find it ...
7
votes
4answers
410 views

How to find source of spawning process?

I have a Java process running on a RedHat Linux instance. The problem is it keeps reappearing after I kill it. I am not sure where to look. I've already went to crontab, but no luck. I've looked at ...
1
vote
1answer
30 views

Why are --older-than and --younger-than killall options missing in RHEL/CentOS?

I've experienced this issue in cleaning up scripts written by developer who were writing for Ubuntu systems, as well as ServerFault questions like this. Is there any reason the -o, -y (--older-than ...
0
votes
1answer
18 views

Why process wasn't killed after closing SSH connection

I launched this command via SSH on a Debian server: watch --precise -n 1 top -b -n 1 -p 27330 | tail -n 1 | awk "{print \$9}" >> 27330.log & After a while I quit my terminal. When I ...
1
vote
1answer
65 views

What does the command pkill -USR1 -n -x dd mean exactly?

I am using dd to do a network transfer of a disk image to an sd card on my BeagleBone. Using pkill -USR1 -n -x dd in an ssh connection to this BeagleBone gives me a status update of the transfer ...
0
votes
1answer
61 views

Kill unresponsive process by name but preserve responsive processes

For some reason, I end up with a fair few Google Chrome Helper processes which stop responding, hogging CPU resources. Usually I just run killall Google\ Chrome\ Helper, however this kills all, ...
1
vote
1answer
20 views

A quit command weaker than windowkill?

Typing in xdotool getwindowfocus windowkill currently terminates the active window and bypasses any safeguards like "would you like to save your work?". Is there a weaker command than windowkill I ...
3
votes
2answers
132 views

Kill a process that keeps restarting

What if 'kill -9' does not work? or How to kill a script which starts new processes? doesn't help me in anyway. I have a python script which starts automatically with another process id using ...
17
votes
2answers
977 views

Why does `kill -l` not list signal numbers of 32 and 33?

Executing kill -l on linux gives: 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1 11) SIGSEGV ...
4
votes
0answers
103 views

Immortal SSH Session

I've got a little TurnKey Linux Debian Squeeze VM that I use for SFTP. I had a user login and transfer a file the other day and now I can't seem to kill the session. I'm still a little shaky in ...
4
votes
1answer
43 views

kill unresponsive process

According to top, process named pccardd loads my CPU nearly 100%: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND ...
0
votes
2answers
38 views

Is killing processes created on startup safe?

I've just got a vserver running debian 7 and whenever I start the server and call the top command, there are very many processes that were started automatically on startup. Can I kill them or are ...
0
votes
2answers
158 views

How to kill a process running in specific script

I have two script files running simultaneously. I just need to kill the java process running in one script without affecting the java process in the another one.
2
votes
1answer
54 views

Killing multiple instances of the script from the script itself

I've couple instances of script.sh running in parallel, doing the same thing, running in background. I'm trying to use a function to kill all the current running scripts when executed. So, for ...
1
vote
2answers
111 views

kill xterm process in a bash

I would like to kill the xterm process I started this way in a script: #!/bin/bash echo "#!/bin/bash" > /tmp/test0 grep file | awk '{print "xterm -hold -e echo",$1,"sleep 10" && pid=$!}' ...
3
votes
1answer
503 views

Why is 'kill -9' killing browser as well as server?

I sometimes have to use kill -9 as a last resort to kill my rails server. Unfortunately, I have to do that often enough that I wrote a helper function in my bash_profile to do it. If I do it manually ...
3
votes
0answers
143 views

Ctrl+Alt+Backspace to kill X server can't be disabled

I would like to disable the Ctrl+Alt+Backspace shortcut to kill my X server. I have tried disabling it in the gnome-keyboard-properties "Layout Options..." dialog. When I start the dialog, the option ...
2
votes
1answer
65 views

I don't know how to cancel job

I'm a beginner about Linux in Korea and English is too. I'm circulating some simulation by using the Linux cluster but I have some problem in my job. I want to cancel any job(ID : 750, 752, 753 name ...
4
votes
0answers
37 views

Show error messages and information that a program was killed on another terminal [duplicate]

If I open a program, say evince, from the GNOME GUI, it is not attached to a terminal. If I send it a signal, it acts accordingly but nothing shows up in my terminal. If I were to open it in a ...
1
vote
1answer
100 views

How to kill - softly? [duplicate]

If I want to kill a process as careful and politely as possible, which signals should I use in a kill command, in which order? I would like to give the programm any kind of time to clean up, if it ...
3
votes
1answer
70 views

Triggering Bash Before Killed [closed]

I just made some kind of service code. Check this out: do_start() { while true do if [[ $(pgrep -fl loopsvn.sh | wc -l) -gt 2 ]]; then echo "Already use by another ...
5
votes
3answers
122 views

How to kill all open windows?

I want to close all windows appearing on my desktop. I've thought to do this through pkill, but I could only manage to kill them one at a time, which is not what I want. The end goal is to put this ...
2
votes
1answer
100 views

How to terminate a shell script?

I'm working on a supercomputer and have a shell script that will automatically schedule a bunch of jobs for me. Once the script is run, I can terminate manually with Ctrl+C. I was running the script ...
2
votes
0answers
77 views

kill or kick all clients from a running vncserver without restarting the server

I encounter quite often the problem, that I want to kick all connected clients from a running vncserver. Even better would be to be able to kick / kill even certain clients. With netstat -tupa | grep ...
3
votes
1answer
107 views

Process management and pkill

I've been studying process management using shell scripts and I'm starting to realise how difficult it is to make sure that it's done right. For example, you can record the PID of a program to a ...
2
votes
1answer
209 views

Kill any service running at a specific port

I am trying to write a script that kills service running at a specific port. This is my script: a=$(ps ax | grep 4990 | grep java | awk '{print $1}') kill -9 $a It's a java program. This script ...
2
votes
1answer
163 views

how to execute more than one command gnome-terminal

I have a script which is running some of (more than 15) applications like: cd mypath sleep 1 gnome-terminal -t App1 --tab -e "./App1" sleep 1 gnome-terminal -t App2 --tab -e "./App2" .. .. sleep ...
2
votes
0answers
33 views

In AwesomeWM, is the use of `c:kill()` as soft as clicking on the red cross in another window manager?

In AwesomeWM, windows are closed with the method c:kill() (bound to Meta-Shift-c) When I use that key binding, the window just close instantly! Therefore I wondered : Is that way as soft as ...
1
vote
1answer
30 views

killall <processname> throughout the system [closed]

I'm opening two terminal windows. Terminal 1 - I run process1 Terminal 2 - I run process2 I then terminate both process using Ctrl+Z in each window. I type killall -9 process1 in Terminal 2 , ...
3
votes
1answer
57 views

Interrupting very long output in tmux

In a (gnome) terminal, if I cat a file which turns out to be much too long, I can always press Ctrl-c to interrupt. However, in tmux, when the same happens, it takes long for the signal produced by ...
2
votes
2answers
429 views

Killing subprocesses after the script has finished or is killed

Say I have a script like the following #!/usr/bin/env zsh ./subscript.sh & # do stuff ... # do more stuff I would like the process running subscript.sh (and any processes initiated by it) to be ...
2
votes
1answer
49 views

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 ...
26
votes
2answers
2k views

Will Linux start killing my processes without asking me if memory gets short?

I was running a shell script with commands to run several memory-intensive programs (2-5 GB) back-to-back. When I went back to check on the progress of my script I was surprised to discover that some ...
1
vote
1answer
590 views

kill pid is not working? [duplicate]

This is pretty weird now. I am trying to kill a process by using its pid but it is not working at all. root@machineA:/home/david# ps aux | grep modelling david 5075 0.0 0.0 1285420 29404 ? ...
1
vote
2answers
98 views

Temporarily freeze a process upon shell interaction

Let's say on a single console I have tail -F running, showing the output of many log files in realtime. Sometimes I need to run commands there too, however, and examine their output briefly, without ...
1
vote
1answer
266 views

nodejs sub processes in nohup bash script lock up

I run scripts with nohup that contain a list of a few hundred to a few thousand nodejs commands. These nodejs sub processes sync data from mysql and salesforce to couchdb. $ nohup ...
1
vote
1answer
70 views

getting pid of two last commands executed in background and do stuff

I wrote this bash: #!/bin/bash eval "(a command) &" pid1=$! eval "(while kill -0 $pid1; do .... ; done) &" #It creates file.txt after few seconds pid2=$! if [ -s ...
3
votes
5answers
790 views

Run a process to particular/dedicated pid only

I have a c program executable or shell script which I want to run very often. If I want to stop/pause or to notify something I will send signal to that process. So every time I have to check the pid ...
3
votes
5answers
1k views

Getting pid of bash script from itself

I have a bash script with doing lot of things called script.sh: #!/bin/bash #It #Is #Doing #Things Is there a way that I be able to get the proccess of script and then kill it after 5 minutes? ...
2
votes
2answers
228 views

Killing background process in bash script when exiting the script

I have a script that tail a file while displaying a clock in the top right corner. I took the clock part from the internet, and it works ok. The entire script is something like (I simplified): while ...
4
votes
3answers
78 views

How to send SIGKILLs to entire pipeline?

while true; do # process substitution instead of usual pipeline to avoid waiting for all programs handle_input_with_timeout < <( prog1 | prog2 | prog3 ) echo "Data stopped flowing. ...
0
votes
1answer
117 views

Job started by procmail does not appear in ps-output and cannot be stopped, even not after reboot

For testing purposes I called procmail by my .forward file |/usr/bin/procmail and by the rules in .procmailrc it started a job named "start", which was simply an infinite loop while true do ...
0
votes
1answer
176 views

Directory locked! [closed]

I have been trying to install virtualbox using this command: sudo apt-get install virtualbox.qt But I am getting this error: E: Unable to lock directory /var/cache/apt/archives/ I have been ...
8
votes
4answers
427 views

Terminate every background process

I have a few Stopped background processes. kill $(jobs -p) and kill `jobs -p` have no effect kill %1, kill %2, etc. successfully terminate individual processes How can I kill every background ...
7
votes
5answers
7k views

Kill all descendant processes [duplicate]

I'm writing an application. It has the ability to spawn various external processes. When the application closes, I want any processes it has spawned to be killed. Sounds easy enough, right? Look up ...
2
votes
2answers
44 views

Output of one command is piped to another one; how to close both?

I call Qt Assistant like suggested on stackoverflow: nc -lkU ~/.assistantfifo | assistant -enableRemoteControl & Qt Assistant window is opened, and if I call jobs, it returns: [1] + running ...
2
votes
2answers
205 views

Bash script to signal a concurrently running instance (same script) about a condition and increment counter

Background Here's what I want to achieve. I have a (potentially) long-running process. Now I have locking in place just fine and all is generally in order. However, since this is a scheduled job, ...
0
votes
1answer
82 views

Can a script be running even after it's been killed?

I know it sounds so stupid and I know it IS stupid but I ran a unix script to send me and my friend emails every few seconds to test mailx. Stupid thing is I used $ while true; do blah blah blah... ...