Questions tagged [kill]

Kill is an operation of removing an object or process from memory so that other processes/variables can use them.

1603 questions
82
votes
15 answers

Ensuring subprocesses are dead on exiting Python program

Is there a way to ensure all created subprocess are dead at exit time of a Python program? By subprocess I mean those created with subprocess.Popen(). If not, should I iterate over all of the issuing kills and then kills -9? anything cleaner?
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
72
votes
10 answers

How do I kill a process using Vb.NET or C#?

I have a scenario where I have to check whether user has already opened Microsoft Word. If he has, then I have to kill the winword.exe process and continue to execute my code. Does any one have any straight-forward code for killing a process using…
bugBurger
  • 6,950
  • 9
  • 32
  • 39
69
votes
9 answers

How to kill all subprocesses of shell?

I'm writing a bash script, which does several things. In the beginning it starts several monitor scripts, each of them runs some other tools. At the end of my main script, I would like to kill all things that were spawned from my shell. So, it might…
user80168
65
votes
7 answers

How is it possible that kill -9 for a process on Linux has no effect?

I'm writing a plugin to highlight text strings automatically as you visit a web site. It's like the highlight search results but automatic and for many words; it could be used for people with allergies to make words really stand out, for example,…
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
63
votes
6 answers

how to kill hadoop jobs

I want to kill all my hadoop jobs automatically when my code encounters an unhandled exception. I am wondering what is the best practice to do it? Thanks
Frank
  • 7,235
  • 9
  • 46
  • 56
58
votes
6 answers

How to kill an application with all its activities?

Possible Duplicate: Quitting an application - is that frowned upon? I want to offer the user an option to exit the application as I need to delete some sensitive data, which is stored in the SharedPreferences as long as the application needs…
Nils
  • 1,705
  • 6
  • 23
  • 32
58
votes
12 answers

Starting apache fails (could not bind to address 0.0.0.0:80)

Update: Already fixed, it seems that one of VirtualHosts configurations files was wrong in sites-enabled. I have Ubuntu 11.10 When I run the command to start apache2: sudo /etc/init.d/apache2 start I get the following error message: Starting web…
rfc1484
  • 9,441
  • 16
  • 72
  • 123
51
votes
5 answers

Killing a defunct process on UNIX system

I have a defunct process on my system: abc 22093 19508 0 23:29 pts/4 00:00:00 grep ProcA abc 31756 1 0 Dec08 ? 00:00:00 [ProcA_my_collect] How can I kill the above process, without a reboot of the machine? I have…
gagneet
  • 35,729
  • 29
  • 78
  • 113
48
votes
2 answers

Terminating idle mysql connections

I see a lot of connections are open and remain idle for a long time, say 5 minutes. Is there any solution to terminate / close it from server without restarting the mysql service? I am maintaining a legacy PHP system and can not close the…
shantanuo
  • 31,689
  • 78
  • 245
  • 403
48
votes
4 answers

Python: how to kill child process(es) when parent dies?

The child process is started with subprocess.Popen(arg) Is there a way to ensure it is killed when parent terminates abnormally? I need this to work both on Windows and Linux. I am aware of this solution for Linux. Edit: the requirement of starting…
user443854
  • 7,096
  • 13
  • 48
  • 63
44
votes
3 answers

How to kill a child process by the parent process?

I create a child process using a fork(). How can the parent process kill the child process if the child process cannot complete its execution within 30 seconds? I want to allow the child process to execute up to 30 seconds. If it takes more than 30…
miraj
  • 493
  • 2
  • 6
  • 7
42
votes
3 answers

How do I kill a process in MySQL running within Amazon RDS?

I’m using MySql 5.5.37. As root, I’m trying to kill a transaction that’s locking some tables. I run SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX\G and get the output … *************************** 6. row *************************** …
Dave
  • 15,639
  • 133
  • 442
  • 830
39
votes
5 answers

How to kill process inside container? Docker top command

I have simple example from official guide at docker website. I run the following: sudo docker run -d ubuntu:latest /bin/sh -c "while true; do echo hello world; sleep 1; done" a66asdasdhqie123... Then take some output from created container: sudo…
Timur Fayzrakhmanov
  • 17,967
  • 20
  • 64
  • 95
38
votes
5 answers

How to kill a nohup process?

I executed the following command $ nohup ./tests.run.pl 0 & now when I try to kill it (and the executions that are started from this script) using $ kill -0 it does not work. How can I kill a nohupped process and the processes that…
polerto
  • 1,750
  • 5
  • 29
  • 50
37
votes
5 answers

Kill process after a given time bash?

I have a script that tries to make a DB connection using another program and the timeout(2.5min) of the program is to long. I want to add this functionality to the script. If it takes longer then 5 seconds to connect, kill the process Else kill the…
krizzo
  • 1,823
  • 5
  • 30
  • 52