kill

How do you kill a PTY.spawn call in Ruby?

If I run a command like this, using ruby's pty class, how do I kill it if I find a certain input string? cmd = "appcfg.py update cdn" PTY.spawn("#{cmd} 2>&1") do | input, output, pid | begin input.expect("Email:") do output.write("#{credentials[:username]}\n") end input.expect("Password:") do output.write("#{cr...

I just can't kill Java thread.

I have a thread that downloads some images from internet using different proxies. Sometimes it hangs, and can't be killed by any means. public HttpURLConnection uc; public InputStream in; Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("server", 8080)); URL url = new URL("http://images.com/image.jpg"); uc = (HttpURLConne...

what's "sure kill" when talking about NFS mount option?

In the following link http://www.faqs.org/docs/Linux-HOWTO/NFS-HOWTO.html It said a process is not killable except by a "sure kill", but what's sure kill? hard (NFS client mount option) The program accessing a file on a NFS mounted file system will hang when the server crashes. The process cannot be interrupted or kille...

Fork two processes and kill the second when the first is done

...

What happens if you kill a long-running alter query?

What happens if you kill a long-running alter query? Will the alter query simply revert? How long could that take (as a proportion of the time it has already been running)? What if that query is being replicated onto another server? Will killing the process on the other server revert the original server's alter query? We're running mys...

C# How to kill parent thread

A parent has several child threads. If user click on stop button the parent thread should be killed with all child threads. //calls a main thread mainThread = new Thread(new ThreadStart(startWorking)); mainThread.Start(); //////////////////////////////////////////////// startWorking() { ManualResetEventInstance ...

SQL: Interrupting a query

I've worked on a project using a proprietary non-SQL DB where queries could be interrupted and in the codebase there were quite some spots where that functionnality was used and made perfect sense (for example to stop a long running query that gets cancelled by the user, or when a more recent query takes place and renders the previous qu...

Kill a 10 minute old zombie process in linux bash script

I've been tinkering with a regex answer by yukondude with little success. I'm trying to kill processes that are older than 10 minutes. I already know what the process IDs are. I'm looping over an array every 10 min to see if any lingering procs are around and need to be killed. Anybody have any quick thoughts on this? Thanks, Steve ps ...

How to kill a process from VC++

Am using VC++ compiler i want to know how to kill a process. is there any functions. i tried with TerminateProcess(); but i couldn't do... ...

How can I prevent my Android app/service from being "killed" from a task manager?

It is very important that my service stay running until someone with a password stops the service from my UI screen. My app runs great but it is designed to be turned on/off by parents (with a password) on their kids phones. I have managed to make everything work but the problem I'm having is that if the kid uses a task manager to kill m...

How should I clean up hung grandchild processes when an alarm trips in Perl?

I have a parallelized automation script which needs to call many other scripts, some of which hang because they (incorrectly) wait for standard input or wait around for various other things that aren't going to happen. That's not a big deal because I catch those with alarm. The trick is to shut down those hung grandchild processes when t...

If a process is killed with a sigkill how do I make it run again?

I have a process that other processes are trying to kill and if they manage to do it, how can I make sure the process will run again? ...

Android: When application was killed, how to set entrypoint for new startup?

I am using a separate class with only static fields, to store current application data. It is partly populated from sharedpreferences on application startup. The rest is data like results of some action, used for further browsing these results (multiple activities that use the results). I can go to the home screen, start other applicati...

Can I force Perl Devel::Cover to generate a coverage report if I killed the build testcover process before it was finished?

If I am able to start up Devel::Cover successfully and it starts to collect data in the cover_db directory, can I then kill the process and then after the fact get Devel::Cover or some other utility to process those binary Devel::Cover run files and structure files into the HTML coverage report? To ask the question another way ... Can...

Kill process by name in python

Hello, I'm trying to kill a process (specifically iChat) using python. I know how to use the command: ps -A | grep iChat Then: kill -9 PID However, I'm not exactly sure how to translate these commands over to python. My guess is that it's not very difficult but I just don't know. Any help would be greatly appreciated! ...

how can I kill a Linux process in java with SIGKILL Process.destroy() does SIGTERM

In Linux when I run the destroy function on java.lang.Process object (Which is true typed java.lang.UNIXProcess ) it sends a SIGTERM signal to process, is there a way to kill it with SIGKILL? ...

Robustly killing Windows programs stuck reporting 'problems'

I am looking for a means to kill a Windows exe program that, when being tested from a python script, crashes and presents a dialog to the user; as this program is invoked many times, and may crash repeatedly, this is not suitable. The problem dialog is the standard reporting of a Windows error: "Foo.exe has encountered a problem and ne...

Android: How to receive process signals in an activity to kill child process ?

My application calls Runtime.exec() to launch an executable in a separate process at start up time. I would like this child process to get killed when the parent activity exits. Now I can use onDestroy() to handle regular cases, but not "Force quit", shutdowns from DDMS, or kill from the console since those don't run onDestroy(). The add...

Problem with fork exec kill when redirecting output in perl

I created a script in perl to run programs with a timeout. If the program being executed takes longer then the timeout than the script kills this program and returns the message "TIMEOUT". The script worked quite well until I decided to redirect the output of the executed program. When the stdout and stderr are being redirected, the p...

kill -9 and production application

Which problem can cause kill -9 in production application (in linux to be exact)? I have application which do some periodical work, stopping these takes long time, and I don't care if some jobs will be aborted - work can be finished by new processes. So can I use kill -9 just to stop it immediately or this can cause serious OS problem...