Solved

An application that doesn't respond to SIGTERM

Posted on 2006-07-08
7
323 Views
Last Modified: 2008-01-09
I have a couple of relatively complicated Java applications that run as daemons (i.e. it is running using nohup on Linux with standard output and error teed to a log file and redirected to /dev/null).

One of them has a resource problem, which I'm trying to diagnose using the -Xrunhprof:file=/tmp/indexd.hprof,format=b switch on the Java VM (Sun JDK1.5) to generate an HPROF file that I can look at with HAT. There's an on-going thread about this profiling at http:Q_21888827.html.

To get the dump I need to kill the process. However, the process isn't responding to SIGTERM. This has nothing to do with the nohup set-up, because by other application terminates perfectly well. SIGKILL is not an option because that prevents the HPROF file from being generated.

The application uses a lot of 3rd party class libraries.

Should I assume that one of these classes has installed a ShutdownHook (because it isn't me)? If so, what's the best way to find out what's stopping SIGTERM?
0
Comment
Question by:rstaveley
  • 3
  • 3
7 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 125 total points
Comment Utility
Are you sure you're using the right pid?

>>Should I assume that one of these classes has installed a ShutdownHook (because it isn't me)?

Not sure that in itself would make any difference - it should just *respond* to the signal, not hinder it
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 125 total points
Comment Utility
>>Are you sure you're using the right pid?

i.e. the 'root' pid
0
 
LVL 23

Accepted Solution

by:
Ajay-Singh earned 125 total points
Comment Utility
> Should I assume that one of these classes has installed a ShutdownHook
> (because it isn't me)? If so, what's the best way to find out what's
> stopping SIGTERM?
It could be the case that the shutdown hook is running. do you see application getting terminated after sometime when shutdown hooks are done?
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 17

Author Comment

by:rstaveley
Comment Utility
>>Are you sure you're using the right pid?

Only one PID shows in the task listing. I haven't checked that's the root, but I'd hav thought do
0
 
LVL 17

Author Comment

by:rstaveley
Comment Utility
> It could be the case that the shutdown hook is running. do you see application getting terminated after sometime when shutdown hooks are done?

No it stays a it is
0
 
LVL 17

Author Comment

by:rstaveley
Comment Utility
Looks like it was a load of java.io.File.deleteOnExit "hooks" that clobbered the VM.
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
:-)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now