avatar
java & signal process# Java - 爪哇娇娃
x*o
1
dose java has signal process like unix system call.
For example, if i run a java program in a jvm and send -9 to the running
process,
how to let the java program responses to -9 signal?
Thanks,
avatar
x*o
2
re

【在 x******o 的大作中提到】
: dose java has signal process like unix system call.
: For example, if i run a java program in a jvm and send -9 to the running
: process,
: how to let the java program responses to -9 signal?
: Thanks,

avatar
x*o
3
any body know this issue?
dose java has signal process like unix system call.
For example, if i run a java program in a jvm and send -9 to the running
process,
how to let the java program responses to -9 signal?
avatar
l*0
4
发给program的signal,是在call的时候,还是运行过程中?

【在 x******o 的大作中提到】
: any body know this issue?
: dose java has signal process like unix system call.
: For example, if i run a java program in a jvm and send -9 to the running
: process,
: how to let the java program responses to -9 signal?

avatar
x*o
5
let's say that i have one process running at backend
(it is a java program like start from command line by:
java -cp ... MyJava.class) and suppose this process id is 101.
now, i send the signal from command line (on unix):
kill -9 101
how can i let MyJava.class response to -9 signal?
I think that JVM will take -9 signal at first and there is no ways for
MyJava.class to response -9 signal in this case.
So is there any other way for java program (like MyJava.class) to response
signal?
Thanks
avatar
Z*e
6
"Two signals are unable to be redefined by a signal handler. SIGKILL always
stops a process and SIGSTOP always moves a process from the foreground to
the background. These two signals cannot be "caught" by a signal handler."
so there you go, unix process cannot trap SIGKIL
I think it's prossible to trap other signals by using sun.misc.Signal

【在 x******o 的大作中提到】
: let's say that i have one process running at backend
: (it is a java program like start from command line by:
: java -cp ... MyJava.class) and suppose this process id is 101.
: now, i send the signal from command line (on unix):
: kill -9 101
: how can i let MyJava.class response to -9 signal?
: I think that JVM will take -9 signal at first and there is no ways for
: MyJava.class to response -9 signal in this case.
: So is there any other way for java program (like MyJava.class) to response
: signal?

avatar
x*o
7
Thanks, ZeeGee
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。