Operating System - HP-UX
1833059 Members
2573 Online
110049 Solutions
New Discussion

Re: UNIX Signals and Process

 
Cao Da Shi
Occasional Advisor

UNIX Signals and Process

Under which conditions is a process when it will stop responding to all other signals except the kill (9)?
Always Learning
12 REPLIES 12
Sridhar Bhaskarla
Honored Contributor

Re: UNIX Signals and Process

Hi,

A process may stop responding if it is waiting on something. One good example is a process waiting on it's disk IO request to complete.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Bill Hassell
Honored Contributor

Re: UNIX Signals and Process

A signal is just that: a flag is set in the process table and the next time the process begins running, the flag will folllow the program's instructions (or take the default action if nothing was specified). This is a general answer to a general question.

Any program can deal with a kill signal anyway it wants to--including ignore it. If you wrote the program, then look at the trap handling.

For programs that are supposed to work correctly but hang, this is usually due to I/O, serial I/O or more typically today, LAN I/O. However, LAN is extremely complicated because there are so many methods to communicate over the same wire. Typical LAN problems that cause programs to hang are due to connections that are trashed when someone does not log out properly, or their PC crashes.


Bill Hassell, sysadmin
Cao Da Shi
Occasional Advisor

Re: UNIX Signals and Process

If a process is waiting for disk I/O, even kill -9 will not be able to get it out. I may miss an important clue here. The process stops responding to all signals but -9. The "kill -9" command will take effect immedately, but all other signals will have to wait there.
Always Learning
T G Manikandan
Honored Contributor

Re: UNIX Signals and Process

For example take the 9 and 15 of kill

The kill -9 is a force shutdown of a process.
which shuts the process whatever may be the stage.

The other kill options like the kill -15 is a orderly shutdown of a process.

So whenever a kill(9) is given the process is forced to shutdown.
you are right,
If a process hangs during some operation (such as I/O), it cannot die until it is allowed to run.So giving a kill will have no effect on that process.


Thanks
Cao Da Shi
Occasional Advisor

Re: UNIX Signals and Process

Yes. Thanks.
So could someone give me a clue or a wild guess what is the process doing at this moment? There is a case in which the process stops running for more than two hours and then it continues. When it stops, only "kill -9" has an immediate effect, all other signals will have to wait for more than two hours to take effect, when the process resumes running.
Always Learning
Arthur Pols
Advisor

Re: UNIX Signals and Process

Dear Cao Da Shi,

There is a nice tool "tusc" to trace what a process is doing. And with a manual page added as well.
It's showing everything a process does, take your time.

It's downloadable from: FTP Directory /dist/networking/tools/ at ftp.cup.hp.com
Latest version: tusc.7.3.shar

I hope this tool severe's your needs.

Arthur

PS This is not supported by HP, but often used.

The purpose of education is to replace an empty mind with an open one.
Vishal Augustine
Frequent Advisor

Re: UNIX Signals and Process

Did u get the answer ? What was ur scenario ? Tried tusc ?

A runaway process (using 100% CPU) due to memory leak usually stops responding to all signals but signal 9

Thanks and Regards
Vishal
Cao Da Shi
Occasional Advisor

Re: UNIX Signals and Process

Thanks to you all.
tusc has been considered. But this symptom usually repeats after more than several days of intesive runing under heavy load. I rule out this option because I'm afraid the output will first block the system. Maybe there is someway in this case when using tusc, or another tool is available. Besides, this process have hundreds of threads on HP-UX 11.00.

Always Learning
Christopher Caldwell
Honored Contributor

Re: UNIX Signals and Process

The process has decided to "catch" or block all signals (either in a signal handler because you've already caught and began dispositioning a signal or just flat out in the code).

You cannot catch or ignore SIGKILL.
Ralph Grothe
Honored Contributor

Re: UNIX Signals and Process

Afaik, there are only two signals which cannot be ignored nor caught by processes, these are

SIGKILL, SIGSTOP

see "man 5 signal" for details.

Apart from these a process/program is free to install its own signal handler to do on arrival of the other signals (almost) whatever it wishes.
Madness, thy name is system administration
Wodisch
Honored Contributor

Re: UNIX Signals and Process

Hi,

I guess the point you are looking for is this one:
when a "signal" is sent to a process, this is simply memorized in the receiving process's status information.
It will only terminate (or respond or ignore) dur to that signal as soon as it gets CPU time - if it does not get any (e.g. due to waiting for some slow I/O to finish), it will simply not notice that it is already *dead* (well, until it gets CPU time)...

HTH,
Wodisch
Roger Baptiste
Honored Contributor

Re: UNIX Signals and Process

Cao,

Run glance , select the process and see what is it Waiting on (W option). That should give some clue.

HTh
raj
Take it easy.