Jump to content

Unix Advanced: Difference between revisions

m
mNo edit summary
Line 67: Line 67:
  cokane 68730  0.0  0.3  1620 1324  pi  T    5:36PM  0:00.02 slrn
  cokane 68730  0.0  0.3  1620 1324  pi  T    5:36PM  0:00.02 slrn
  cokane 68741  0.0  0.0  388  220  pi  R+    5:36PM  0:00.00 ps -u
  cokane 68741  0.0  0.0  388  220  pi  R+    5:36PM  0:00.00 ps -u
  prompt$ ps
  prompt$ ps
   PID  TT  STAT      TIME COMMAND
   PID  TT  STAT      TIME COMMAND
Line 89: Line 90:


You see in the above example that when a process gets killed (or finishes itself), the shell will print that the process has finished or has been killed. In the above example you can see that it shows the job number in square brackets, then the reason the process returned (that it was killed) and the name of the process.
You see in the above example that when a process gets killed (or finishes itself), the shell will print that the process has finished or has been killed. In the above example you can see that it shows the job number in square brackets, then the reason the process returned (that it was killed) and the name of the process.
Signals
 
== Signals ==


Now I will (attempt to) explain signals in UNIX...
Now I will (attempt to) explain signals in UNIX...
Line 97: Line 99:
Below I will list some of the most common signals and what they're used for. I reserve the right to be very wrong about some of them :o)
Below I will list some of the most common signals and what they're used for. I reserve the right to be very wrong about some of them :o)


*SIGKILL        As explained already... to kill a process
*SIGKILL         
As explained already... to kill a process


*SIGTERM         Similar to SIGKILL but it won't kill the process straight away.  
*SIGTERM          
Similar to SIGKILL but it won't kill the process straight away.  


*SIGSTOP         This is the signal which suspends a process..
*SIGSTOP          
This is the signal which suspends a process..


*SIGSTP Similar to SIGSTOP, this is the signal that pressing
*SIGSTP
CTRL + Z sends.
Similar to SIGSTOP, this is the signal that pressing CTRL + Z sends.


*SIGCONT         The signal sent to continue a suspended process.
*SIGCONT          
The signal sent to continue a suspended process.


*SIGTTOU         This occurs when a process running in the background attempts
*SIGTTOU          
to write to the terminal. The process gets suspended.
This occurs when a process running in the background attempts to write to the terminal. The process gets suspended.


*SIGTTIN As above except occurs when process tries to read input
*SIGTTIN
from terminal
As above except occurs when process tries to read input from terminal.


*SIGHUP The "hang up" signal, nowadays sending this to a process
*SIGHUP
will cause the process (if it's a daemon) to re-read its  
The "hang up" signal, nowadays sending this to a process will cause the process (if it's a daemon) to re-read its configuration files without you having to restart the process itself.
configuration files without you having to restart the process  
itself.




Line 130: Line 134:


Hopefully you've found this tutorial a bit helpful and have maybe learnt something as well from it as well.
Hopefully you've found this tutorial a bit helpful and have maybe learnt something as well from it as well.
== Links ==
496

edits