Solved

An application that doesn't respond to SIGTERM

Posted on 2006-07-08
7
328 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
ID: 17064589
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
ID: 17064613
>>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
ID: 17064629
> 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 17

Author Comment

by:rstaveley
ID: 17064946
>>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
ID: 17064949
> 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
ID: 17101929
Looks like it was a load of java.io.File.deleteOnExit "hooks" that clobbered the VM.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17102369
:-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
My project did see openJDK that I installed. What could be the problem 7 123
Java - Why doesn't this JFrame work 3 41
jar file executable 12 40
servlet doXXX methods 3 36
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

910 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

19 Experts available now in Live!

Get 1:1 Help Now