|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] capturing SIGKILL in DomU
Hi Srujan,what about adding a signal handler to qemu-dm in the tools/ioemu-dir of the user-space tools? Using the signal() API? Nevertheless why would you like to catch SIGKILL? This one (as can be seen using included program source and killing it using kill -9 pid or kill -SIGKILL pid) is not being caught at all nevertheless most of the other signals can be caught.
This is the source of the example mentioned:
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
void sig_handler(int sig) {
fprintf(stderr, "Signal %d caught.\n", sig);
exit(sig);
}
int main()
{
signal(SIGINT, sig_handler);
signal(SIGKILL, sig_handler);
sleep(10000);
return 0;
}
When I did try SIGINT (Ctrl + C or kill -2 pid) it caught the signal
well but when I did try kill -9 pid (or kill -SIGKILL pid respectively)
it was not working at all since it killed the process instead of going
to the signal handler. When you need to catch signals like interruption
signal (Ctrl + C one) this will work fine.
Michal On 10/04/2010 09:03 PM, Srujan D. Kotikela wrote: Hi, I am trying to capture SIGKILL through event channel.On my Dom0, the following process is running (remaining code in attachment). -- Michal Novotny<minovotn@xxxxxxxxxx>, RHCE Virtualization Team (xen userspace), Red Hat _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |