kill

kill - does it kill the process right away?

自作多情 提交于 2019-12-05 13:57:34
what does kill exactly do? I have a parent process which is creating 100 (as an example) child processes one after another. At the end of any child's job, I kill the child with kill(pid_of_child, SIGKILL) and I cannot see that in ps output. But if something goes wrong with the parent process and I exit from the parent process with exit(1) (at this point only 1 child is there - I can check tht in ps ), at that point I see a lot of <defunct> processes whose ppid is pid of parent process. How is that possible? did kill not kill the child processes entirely? kill doesn't kill anything . It sends

How can I kill a process, using VBScript, started by a particular user

天大地大妈咪最大 提交于 2019-12-05 09:06:17
I have multiple users running attachemate on a Windows 2003 server. I want to kill attachemate.exe started by user_1 without killing attachemate.exe started by user_2. I want to use VBScript. You could use this to find out who the process owner is, then once you have that you can use Win32_Process to kill the process by the process ID. MSDN Win32_Process class details MSDN Terminating a process with Win32_Process There is surely a cleaner way to do this, but here's what I came up with. NOTE: This doesn't deal with multiple processes of the same name of course, but I figure you can work that

ubuntu下tomcat监视运行进度方法

陌路散爱 提交于 2019-12-05 03:21:41
如果你一直在Windows下使用Tomcat,那么你一定会知道:在运行Tomcat的时候,会弹出新的控制台窗口,然 后相关的服务器状态信息以及程序运行过程中输出的信息都会在这个新窗口中显示出来。但是到了Linux,自带的shell文件并不会打开一个新的终端窗 口,这使得一些Linux新手(包括我)调试程序的时候遇到不少麻烦。这个问题该如何解决呢? 首 先,我们得知道那些在Windows的控制台中显示的信息到现在都跑到哪里去了。这个问题不难,就在logs目录的两个文件中,一个是 catalina.out,一个则是localhost.[日期].log。原来在默认的情况下,Tomcat在Linux中是将信息输出到日志文件中 了。这样一来,我们就有解决办法了,要么改变信息的输出方式,要么就想办法监测那两个日志文件。最后,我选择了后者,具体的做法很简单:使用tail命令 加上f参数即可,其中f参数的含义就是“即时输出文件变化后追加的数据”。具体的命令为:tail -f catalina.out。 ALT+F2 输入 gnome-terminal即可打开终端 关闭 shutdown.sh -s 启动 cd /usr/local/apache-tomcat-6.0.10/bin/ 2 ./startup.sh 3 ./catalina.sh run(显示信息启动,关掉会关闭TOMCAT)

How can one send a Ctrl-Break to a running Linux process?

断了今生、忘了曾经 提交于 2019-12-05 02:30:24
I am debugging a memory leak in an application running on Sun's JDK 1.4.2_18. It appears that this version supports the command line param -XX:+HeapDumpOnCtrlBreak which supposedly causes the JVM to dump heap when it encounters a control-break. How does one send this to a background process on a Linux box? It appears that kill signals are the way this ought to work, but I kill -l doesn't report anything that is obviously a Ctrl-Break, at least on my Ubuntu box. Update: I tested Kill -3 with Sun JDK 1.4.2_18 (_14 was the first to dump heap this way), and it worked. A heap dump file was created,

Simulate Ctrl-C keyboard interrupt in Python while working in Linux

懵懂的女人 提交于 2019-12-05 01:42:56
I am working on some scripts (in the company I work in) that are loaded/unloaded into hypervisors to fire a piece of code when an event occurs. The only way to actually unload a script is to hit Ctrl - C . I am writing a function in Python that automates the process As soon as it sees the string "done" in the output of the program, it should kill the vprobe . I am using subprocess.Popen to execute the command: lineList = buff.readlines() cmd = "vprobe /vprobe/myhello.emt" p = subprocess.Popen(args = cmd, shell=True,stdout = buff, universal_newlines = True,preexec_fn=os.setsid) while not re

alternative to finish() method for Service class? To kill it dead

六眼飞鱼酱① 提交于 2019-12-04 23:30:13
I have used the method finish() before in several activities without problems. however when I tried to call it inside of the broadcast receiver I get the error message from the compiler that "the method finish() is undefined for the type AudioService" AudioService is the name of my Service class in my Android app. If there is no finish() method in a Service than what can I call to kill this Service dead? use this line: this.stopSelf(); to kill itself. Or from outside use stopService(intent); you can try as to stop your AudioService service from broadcast receiver : Intent intent = new Intent()

“Gracefully” killing a process

浪尽此生 提交于 2019-12-04 15:27:27
问题 Right now I am using Process.Kill() to kill a process. Is there a way though, instead of just killing it immediately, that I can like send a message to the process instructing it to close so that it can gracefully clean up and shut down. Basically, I'm looking for the equivlent to just clicking the red X in the upper right hand corner, which I believe DOES send a message to the application requesting a shut down. 回答1: If the process has a windows interface (as you refer to the red "X"), you

Can GDB kill a specific thread?

房东的猫 提交于 2019-12-04 12:09:03
I'm running an application (firefox) and I would like to know if it's possible to use GDB to attach to the process and kill a specific thread . Is there a way to do this? I understand that this operation will probably crash the app. EDIT: In this debugging session, ps -ax revealed that firefox pid is 1328: $ gdb /Applications/Firefox.app/Contents/MacOS/firefox 1328 GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov 3 21:59:02 UTC 2011) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or

How do I cancel all pending intents that are qued for intent Service

守給你的承諾、 提交于 2019-12-04 09:55:09
I have an intentservice that gets qued by the user and by my app automatically. I need to be able to kill all pending intents that are qued when the user logs out of my application, but I cannot seem to get that to work. I have tried stopService() and stopself(), but the intents continue to fire off the intentservice after the user has logged out. I would try to get the id of the intent but that is difficult as everytime the intentservice starts, the variable holding the intent id's is empty. Here is my intentservice code: public class MainUploadIntentService extends IntentService { private

kill signal example

谁说胖子不能爱 提交于 2019-12-04 08:36:39
I'm trying this example that I took from: http://www.cs.cf.ac.uk/Dave/C/node24.html : #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <signal.h> void sighup(); /* routines child will call upon sigtrap */ void sigint(); void sigquit(); main() { int pid; /* get child process */ if ((pid = fork()) < 0) { perror("fork"); exit(1); } if (pid == 0) { /* child */ printf("\nI am the new child!\n\n"); signal(SIGHUP,sighup); /* set function calls */ signal(SIGINT,sigint); signal(SIGQUIT, sigquit); printf("\nChild going to loop...\n\n"); for(;;); /* loop for ever */ } else /* parent */