How to detect SIGTERM,SIGKILL signal from JAVA
807580Mar 9 2010 — edited Mar 9 2010Dear All
We have JBOSS server running on Linux we need to track Graceful Shutdown(SIGTERM) and Forceful Shutdown(SIGKILL) timestamp , SIGNAL and write it into one log file,
We generally do
$kill PID For Graceful Shutdown(SIGTERM)
$kill -9 PID For Forceful Shutdown(SIGKILL)
PID--> the process id of java process associated with JBOSS.
We or else someone is killing the process id of java process associated with JBOSS.
i.e we get Java process ID from `ps -ef|grep java` command output and someone is killing this PID using kill command. I have to track at what timestamp java process is killed and associated SIGNAL information i.e either SIGTERM , SIGKILL or it is for system's abnormal shutdown
Is it possible to track this information using JAVA? if yes Please help me it's an urgent......... Any help is highly appreciate
Regards
Mnmonu