Solved

An application that doesn't respond to SIGTERM

Posted on 2006-07-08
7
338 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Weekend adv creator 3 64
map related example 6 59
Opening PDF on button click and fill new document 2 53
import as existing maven project 3 33
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

680 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