>>>>> "Bryan" == Roycroft, Bryan <BRoycroft at mcom.cit.ie> writes:
[-]
Bryan> what I wanted to know was just what the "HUP" option stood
Bryan> for, as I had an understanding of what kill did, what i've
Bryan> gleaned is that the it is basically the level which is
Bryan> passed to the command, ie if it should shutdown or
Bryan> restart. Also in some examples its followed by a file name,
Bryan> it seems to be the location of the executable that is being
Bryan> restarted. Is this always necessary or can the OS figure
Bryan> out what to restart from the process context, as the advice
Bryan> thats in the column just refer to just the process id or is
Bryan> the HUP the PID and the filename the actual executable to
Bryan> execute, getting the HUP id.
You /could/ look at it as being a kind of level although it's really a
little broader than that.
A signal is a very primitive form of interprocess
communication. Mostly you send signals from a shell or terminal
process to an application process. There are many different signals
and some of them are architecture dependant. See man signal for more
information:
SIGHUP 1 A Hangup detected on controlling terminal
or death of controlling process
SIGINT 2 A Interrupt from keyboard
SIGQUIT 3 C Quit from keyboard
SIGILL 4 C Illegal Instruction
SIGABRT 6 C Abort signal from abort(3)
SIGFPE 8 C Floating point exception
SIGKILL 9 AEF Kill signal
SIGSEGV 11 C Invalid memory reference
SIGPIPE 13 A Broken pipe: write to pipe with no readers
SIGALRM 14 A Timer signal from alarm(2)
SIGTERM 15 A Termination signal
SIGUSR1 30,10,16 A User-defined signal 1
SIGUSR2 31,12,17 A User-defined signal 2
SIGCHLD 20,17,18 B Child stopped or terminated
SIGCONT 19,18,25 Continue if stopped
SIGSTOP 17,19,23 DEF Stop process
SIGTSTP 18,20,24 D Stop typed at tty
SIGTTIN 21,21,26 D tty input for background process
SIGTTOU 22,22,27 D tty output for background process
The kill command is used to send a signal to a process. If you don't
specify a specific signal then SIGTERM is used by default. If you
specify something like kill -9 then signal 9 is sent to the
process. Signal nice as you can see from the table above is the KILL
signal and you can use the numbers and the names interchangebly.
You should /not/ send a KILL signal to a process unless you absolutely
have to. Processes can have files open, pipes open, memory allocated
and then asked to terminate with a TERM signal the signal handler
written as part of the application/daemon closes all used resources
and basically does whatever housekeeping needs to be done before
exiting. When you send a KILL signal to a process it exits immediately
without doing this necessary housekeeping. See man kill for more
information.
The usual way to use kill is kill -signal PID. I'm not sure what you
mean about specifying files ? After you start an executable file
running then you have a process. You then send a signal to the process
id (PID). The PID can be found from the ps command.
Regards,
Dermot.
--
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!