1819682 Members
4349 Online
109605 Solutions
New Discussion юеВ

Signal SIGHUP

 
SOLVED
Go to solution
Alberto Delgado
Occasional Contributor

Signal SIGHUP

Hello,

I have some applications running on HPUX11i and one of them, at certain point, stopped because it was signalled with SIGHUP. I do not have any application sending that signal so it has to be signalled by the OS.

Does anybody know under which conditions the system is throwing this signal?

Thanks!
Regards, Alberto
6 REPLIES 6
Elmar P. Kolkman
Honored Contributor
Solution

Re: Signal SIGHUP

sighup == signal hangup.

This is a signal that is sent when a terminal connection is closed. So it might be the process was linked to a terminal or login session that was closed without stopping the proces first.

But there are lots of other reasons a sighup is sent to a process. For instance, most start/stop scripts use a sighup to 'gently' signal a proces it should stop, before doing it drasticaly with a sigkill (-9).

Do you get the message a lot or sporadic?
Every problem has at least one solution. Only some solutions are harder to find.
Mark Grant
Honored Contributor

Re: Signal SIGHUP

Elmar is correct regarding the terminal nature of SIGHUP (It actually comes from hang up,as in hanging up the telephone line). However, SIGTERM is usually used to ask a process to quit nicely.

I do not think the system will ever send a SIGHUP except as mentioned by Elmar above. Some daemons, such as cron will trap a SIGHUP and re-read their configurations on receipt of the signal. The default action, however, is to quit. My guess would be to look at the "restart" option within the system boot script for this application
Never preceed any demonstration with anything more predictive than "watch this"
Alberto Delgado
Occasional Contributor

Re: Signal SIGHUP

Hi!

The application running was associated to a terminal and probably the terminal crashed and thats why it got that signal as you mentioned.

This happen only once but we are trying to dig wherther there is something more important associated to this.

Thanks a lot!
Best regards, Alberto
Jakes Louw
Trusted Contributor

Re: Signal SIGHUP

If you have set the environment variable TMOUT, as far as I know this will SIGHUP when the timeout period is exceeded.
Trying is the first step to failure - Homer Simpson
Elmar P. Kolkman
Honored Contributor

Re: Signal SIGHUP

But only if no proces is running in the foreground. I've been in environments where they used that too, and if I wanted to keep online, I started top when I was not active for a while.
Every problem has at least one solution. Only some solutions are harder to find.
Jakes Louw
Trusted Contributor

Re: Signal SIGHUP

Elmar

Exactly: if I set TMOUT=600, then run a process in the background ("myprogram &"),
the program will terminate when the parent interactive session is killed after the timeout is exceeded.
You circumvent this by using NOHUP to stop a hangup of the parent killing the background child:
"nohup myprogram &".
Trying is the first step to failure - Homer Simpson