kill

How to prevent an android activity to get killed

三世轮回 提交于 2019-11-29 18:11:18
I have developed an application that does require to do constant network activity. This Activity does the network connections thru an AsyncTask, sometime this work being done in background (application not having focus). My application sometimes gets killed after 30 mins, even if the system does not seem to lack resources (memory). I have read the Activity life cycle in the Application Fundamentals section on developer.android.com , but can't find an answer. What would be the proper way to programmatically prevent my Activty to get killed. Thank you. If you use a Service and make sure it stays

How to call a particular method before killing a storm topology

非 Y 不嫁゛ 提交于 2019-11-29 11:03:40
How to call a particular method before killing a storm topology. I have created a topology in storm, I wanted to call particular method, just before topology gets killed. is there any predefined overridden or any method available to do this in storm framework. Thanks in advance:) There is no such thing... As a workaround, you can deactivate the topology before killing it. This ensures, that Spout.deactivate() is called. If you need to call a method at bolts, use Spout.deactivate() to sent a "notification tuple" (that does not contain data to be processed) through the whole topology. And in

Killing processes opened with popen()?

落爺英雄遲暮 提交于 2019-11-29 10:33:40
I'm opening a long-running process with popen(). For debugging, I'd like to terminate the process before it has completed. Calling pclose() just blocks until the child completes. How can I kill the process? I don't see any easy way to get the pid out of the resource that popen() returns so that I can send it a signal. I suppose I could do something kludgey and try to fudge the pid into the output using some sort of command-line hackery... Frank Farmer Well, landed on a solution: I switched back to proc_open() instead of popen() . Then it's as simple as: $s = proc_get_status($p); posix_kill($s[

Return code when OS kills your process

人盡茶涼 提交于 2019-11-29 08:39:05
I've wanted to test if with multiply processes I'm able to use more than 4GB of ram on 32bit O.S (mine: Ubuntu with 1GB ram). So I've written a small program that mallocs slightly less then 1GB, and do some action on that array, and ran 5 instances of this program vie forks. The thing is, that I suspect that O.S killed 4 of them, and only one survived and displayed it's "PID: I've finished"). (I've tried it with small arrays and got 5 printing, also when I look at the running processes with TOP, I see only one instance..) The weird thing is this - I've received return code 0 (success?) in ALL

Inno Setup Kill a running process

和自甴很熟 提交于 2019-11-29 08:19:37
I have already implemented a way to find whether a process ("iexplore.exe") is running, I now need to find a way to close it (terminate the process) from Inno Setup. strProg := 'iexplore.exe'; winHwnd := FindWindowByWindowName(strProg); MsgBox('winHwnd: ' + inttostr(winHwnd), mbInformation, MB_OK ); if winHwnd <> 0 then retVal:=postmessage(winHwnd,WM_CLOSE,0,0); The message box in the example above will always return 0 therefore no handle is ever gotten. (the WM_CLOSE constant in the example is properly initialized) I need another way of doing this, and hopefully one that does not involve

improper killing of mysqld - now not starting

喜你入骨 提交于 2019-11-29 07:02:46
I stopped mysqld by killing the process id, and then deleted mysqld.sock file also. Now, mysqld is not starting. I know there is some data corruption. But now I need to start MySQL without re-installing it. Below are the logs that generated. InnoDB: using the same InnoDB data or log files. InnoDB: Unable to lock ./ibdata1, error: 11 InnoDB: Check that you do not already have another mysqld process InnoDB: using the same InnoDB data or log files. 140107 8:27:43 InnoDB: Unable to open the first data file InnoDB: Error in opening ./ibdata1 140107 8:27:43 InnoDB: Operating system error number 11

programmatically kill a process in vista/windows 7 in C#

守給你的承諾、 提交于 2019-11-29 06:45:17
I want to kill a process programmatically in vista/windows 7 (I'm not sure if there's significant problems in the implementation of the UAC between the two to make a difference). Right now, my code looks like: if(killProcess){ System.Diagnostics.Process[] process = System.Diagnostics.Process.GetProcessesByName("MyProcessName"); // Before starting the new process make sure no other MyProcessName is running. foreach (System.Diagnostics.Process p in process) { p.Kill(); } myProcess = System.Diagnostics.Process.Start(psi); } I have to do this because I need to make sure that if the user crashes

How can I kill processes in Android?

梦想的初衷 提交于 2019-11-29 05:17:14
I have this code below: package com.example.killall; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.Button; //import android.widget.TextView; import android.app.ActivityManager; public class MainKill extends Activity { private Button BprocessesKill ; //private TextView processesKill; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_kill); final ActivityManager am=(ActivityManager) getSystemService("SYSTEM_ACTIVITY"); BprocessesKill=

How to propagate a signal through a collection of scripts?

99封情书 提交于 2019-11-29 01:13:26
I have an collection of scripts which are controlled by a main one. I want to trap the signal ctrl + c in the main script and propagate it to the others. The other scripts should trap this signal as well ( from the main script ) and do some clean-up ... I have tried to send kill -s SIGINT to the children, but they seem they are unable to catch the signal( even if trap 'Cleanup' SIGINT being defined on the children scripts ) Any clues how to realize this? The following example demonstrates a parent script that does something ( sleep 5 ) after it starts two children that do their own thing (also

Get the PID of a process to kill it, without knowing its full name

心不动则不痛 提交于 2019-11-28 21:34:03
I'm coding an Android application. Now I'm going to a part where the application should kill a process. But I don't know its full name or its PID. I Know the commands: android.os.Process.killProcess(Pid) and android.os.Process.getUidForName("com.android.email") But my problem is that I don't know the full name of the process. It's an native code process, so not something like com.something.something The process is /data/data/com.something.something/mybinary but it's running with commands like /data/data/com.something.something/mybinary -a 123 -b 456 because of this I can't use android.os