kill-process

how to force stop all checked application from list view in android programmatically

扶醉桌前 提交于 2019-12-13 04:15:46
问题 In below given code I want to kill (forcestop) all the checked applications but after restarting my application it's showing the name of these killed applications again. I really don't know if they're really killed or not. Why this is so? kill.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { //Killing selected Apps String savedapp; int code = 0; int count = lv.getAdapter().getCount(); for (int j = 0; j < count; j++) { if (lv.isItemChecked(j)) { Intent ints =

How to kill other apps?

回眸只為那壹抹淺笑 提交于 2019-12-13 03:11:27
问题 Merged with Android-Close Other Apps. How can I kill other applications? I can launch other applications using intents but can't find a way to kill them. This launches the application: Intent i = new Intent(); i.setAction(Intent.ACTION_MAIN); i.addCategory(Intent.CATEGORY_LAUNCHER); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.setComponent( new ComponentName("com.bla.bla...", "com.bla.bla.Main")); context.startActivity(i); I've tried to use the activity manager's kill killBackgroundProcesses

Linux kernel module signal on userspace process killed

假装没事ソ 提交于 2019-12-12 08:55:00
问题 I'm wondering if there is a hook that could be used in a Linux Kernel Module that is fired when a user space application/process is killed ? 回答1: You could first register for a notifier chain within your kernel module. Inside get_signal_to_deliver ( kernel/signal.c ), any process which has just (this being a relative term IMHO) been killed has its PF_SIGNALED flag being set. Here you could check for the name of the current process using its tcomm field like so: char tcomm[sizeof(current->comm

How can I reference ProcessInfo's members and ProcessCE in my Windows CE util?

廉价感情. 提交于 2019-12-12 04:55:46
问题 I found this code from CathalMF here: ProcessInfo[] list = ProcessCE.GetProcesses(); foreach (ProcessInfo pinfo in list) { if (pinfo.FullPath.EndsWith("MyExe.exe")) pinfo.Kill(); } ...and modified it to my ends (no pun intended) like so: ProcessInfo[] list = ProcessCE.GetProcesses(); foreach (ProcessInfo pinfo in list) { if (pinfo.FullPath.EndsWith("HHS.exe")) pinfo.Kill(); // This should work, too, eh? if (pinfo.FullPath.EndsWith("HUtilCE.dll")) pinfo.Kill(); } ...but several things are

Can't kill a process - stopping rails server

余生颓废 提交于 2019-12-12 03:45:27
问题 I am trying to stop rails server from my console (i am using ubuntu) so following the related questions on stack, I tried Ctrl + C pgrep -l ruby and then kill -9 $the_right_pids (and also ps aux | grep ...) but none of these worked. Does anybody have an idea ? Update: I found a solution on a stack post and the issue seems be come from a ruby server bug (when using rubymine?), the solution seems not natural but it can do the trick : stop the process in the console and the refresh the browser

Loop calls process that takes a long time to complete. How do I break out of it?

坚强是说给别人听的谎言 提交于 2019-12-12 02:44:34
问题 I got to this solution yesterday with help from here (it's finding a list of directories to process with HandBrakeCLI, and putting the results in a hard-coded directory): #!/bin/bash source_dir=/Volumes/VolumeName dest_dir=/Volumes/OtherName export dest_dir # export allows use by subprocesses! find "$source_dir" -type d -name "VIDEO_TS" -exec bash -c ' for dir; do name=${dir%/VIDEO_TS} name=${name##*/} ./HandBrakeCLI -i "$dir" -o "$dest_dir/$name.m4v" done ' _ {} + The shell script works fine

Stop OS from killing my Process

大憨熊 提交于 2019-12-11 19:35:34
问题 I have an application in which I am calling ACTION_SEND intent from my main activity . Everything works fine but when I return to my main activity from ACTION_SEND intent then main activity starts its execution from onCreate() method but I want it to be started from onRestart() method. I think its bcz a OS kills my activity to free up space. So is there any way rather than using Service So that I can stop OS from killing my activity ? 回答1: I think its bcz a OS kills my activity to free up

Kill background process launched with shell=True in Windows

送分小仙女□ 提交于 2019-12-11 15:44:05
问题 I'm trying to launch from Python a server to score PMML models in Java. Once the calculations have been made, I want to be able to close that server (i.e. terminate the process). I'm on Windows 10. However, I'm finding it way more confusing than I thought it would be. First I launch the server like this: p = subprocess.Popen('START /B java -jar openscoring-server-executable-1.4.3.jar', shell=True) I make it run on the background so that the CMD window doesn't show up when the user runs the

Stop running python script without killing the interpreter

烂漫一生 提交于 2019-12-11 09:34:27
问题 Before, I were able to kill a python script started with execfile("somescript.py") while in interpreter by pressing Ctrl + C without killing the interpreter. This would cause a KeyboardInterrupt exception that would stop the script and let me use the interpreter again. However, now (I suspect this came with newer version of python), when I press Ctrl + C while running a script, it sometimes also kills the interpreter, throwing me back to Linux command line. For some reason this doesn't happen

bash script to kill php process older then an hour

我们两清 提交于 2019-12-11 03:49:45
问题 I have the following: kill -9 `ps aux | grep php | awk '$9 !~ /[0-9]:[0-9]/' | awk '{print $2}'` What it does is kill process that have been left abandoned by fcgid and kills them to free RAM. I want to run this as a cron every hour but would like to kill processes older then an hour. I'm just not sure how to modified the script to do that. 回答1: Try the following bash code : for i in $(pidof php); do pidtime=$(stat -c '%Y' /proc/$i) now=$(date +%s) ((now - pidtime >= 3600)) && { kill $i;