Results 1 to 2 of 2
hey..
im trying to write a program which will handle the SIGHUP signal..and i read an article about handling signals and the signal() function and all its parameters and how ...
- 10-20-2007 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 60
SIGHUP signal question
hey..
im trying to write a program which will handle the SIGHUP signal..and i read an article about handling signals and the signal() function and all its parameters and how it works..
but the thing is, SIGINT can be tried easily since its the Ctrl+c key stroke..but what's the SIGHUP key stroke?..i read around and it says the following:
SIGHUP, hang up -- Caused by the phone line or terminal connection being dropped.
but what's its key stroke?..what does it do?..when i write the code for handling it, how can i try it?:S..any help would be appreciated..
- 10-20-2007 #2
SIGHUP, like many other signals, is not tied to any particular key on the keyboard.
In the old days, it was common to dial up a computer from your terminal and log in, the same way you log in on a virtual console after pressing, say, <CTRL><ALT><F1> to get to that virtual console in the first place. No PPP, no Internet, no network connection at all. You can still configure your Linux system to accept phone calls via your modem and directly present the caller with a login screen.
Once the user logs in this way, he gets a shell prompt. He can then run programs.
If, during the running of a program, the modem disconnects, the program receives SIGHUP. HUP stands for "hang up", as in hang up the phone.
So if you want to go to that trouble, you generate a SIGHUP that way.
You can also generate a SIGHUP for a particular process number x by going to another virtual terminal or xterm window and typing at the shell prompt:
These days, a common use of SIGHUP is to instruct a running daemon to re-read its configuration file. You would use the above kill command after modifying that configuration file.Code:kill -HUP x
Hope this helps.


Reply With Quote