04-03-2006
When you exit a session, any processes running are sent a HUP signal. Unless the process is ignoring the signal it will exit upon receipt of SIGHUP. The nohup command is one way of protecting processes from this signal.
That has almost nothing to do with foreground/background processes. A foreground process can read characters from /dev/tty while a background process cannot. You can type your interrupt character, usually Control-c. to send SIGINT to all foreground processes. I don't believe that any nohup command will protect jobs from SIGINT. (A few nonstardard nohup commands exist that protect jobs from SIGTERM or SIGQUIT. This violates the Posix standard.)
HUP stands for hang-up. You used to dial up to Unix systems with a modem. You would disconnect by "hanging-up" the connection.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
What the folowing statements means and whats the use of it ?
expr $db_name + 2 >/dev/null 2>&1
Thanks. (7 Replies)
Discussion started by: dhananjaysk
7 Replies
2. Shell Programming and Scripting
Hi
Can anybody tell me what is the meaning of the following code?
i=4 j=1 k=0
Specialy meaning of this line
echo $?
Specialy meaning of this line
echo $?
Specialy meaning of this line
echo $?
Thanks in advance
Sas (3 Replies)
Discussion started by: SasDutta
3 Replies
3. Shell Programming and Scripting
ls -ld | grep $1 /etc/passwd | cut -d: -f6
i need see the content... (4 Replies)
Discussion started by: nadman123
4 Replies
4. Shell Programming and Scripting
Hi all,
could you please tell me whats this stands
##*_
0##*/
i knew this alone if some more is there please tell me that also. (3 Replies)
Discussion started by: Arunprasad
3 Replies
5. Shell Programming and Scripting
while getopts :g:l:h: KEY $*
do
case $KEY
in
g) NAME=$OPTARG ;;
l) LAB=$OPTARG ;;
h) HD=$OPTARG ;;
*) echo "Illegal option: $OPTARG"
echo "$usage"
exitStatus=1
exitGrace
esac
done (2 Replies)
Discussion started by: santosh1234
2 Replies
6. Shell Programming and Scripting
Code:
#!/usr/bin/perl -w
use strict;
use warnings;
#Clears Screen
$CLEAR=`clear`;
print $CLEAR;
i get the below error:
Global symbol "$CLEAR" requires explicit package name at ./mutmg.pl line 6.
Global symbol "$CLEAR" requires explicit package name at ./mutmg.pl line 7. (1 Reply)
Discussion started by: sophos
1 Replies
7. Shell Programming and Scripting
Hi ,
iam new with sed command
D:\bfx_db>sed -ne '/^SP2-*:/S/^\<.*\.*\>$/\2\p' reg.sql >>D:\out.log
The filename, directory name, or volume label syntax is incorrect.
Here my source file is reg.sql , i need the output in out.log
Can anybody Help on this???? (4 Replies)
Discussion started by: mhdmehraj
4 Replies
8. Shell Programming and Scripting
if `egrep -c "safe_mode" /usr/local/lib/php.ini` - gt 0 && " `egrep -c "safe_mode" /usr/local/lib/php.ini` = "On" "
then
echo " Good "
exit
else
echo " Not Good ";
fi
and (4 Replies)
Discussion started by: x-zer0
4 Replies
9. Shell Programming and Scripting
Hi,
I would like to ask about the meaning or purpose of set -e in the script bash, Does it mean if a wrong command in the script it will close or exit the script without continuation thats what happen if i set it in the terminal.
Thanks in advance (3 Replies)
Discussion started by: jao_madn
3 Replies
10. Shell Programming and Scripting
Hi All
Can any one please help me to understand the below Perl Code
package Win32::File;
#
# File.pm
# Written by Douglas_Lankshear@ActiveWare.com
#
# subsequent hacks:
# Gurusamy Sarathy
#
$VERSION = '0.06';
require Exporter;
require DynaLoader;
@ISA= qw( Exporter... (1 Reply)
Discussion started by: adisky123
1 Replies
KILL(1) BSD General Commands Manual KILL(1)
NAME
kill -- terminate or signal a process
SYNOPSIS
kill [-s signal_name] pid ...
kill -l [exit_status]
kill -signal_name pid ...
kill -signal_number pid ...
DESCRIPTION
The kill utility sends a signal to the processes specified by the pid operands.
Only the super-user may send signals to other users' processes.
The options are as follows:
-s signal_name
A symbolic signal name specifying the signal to be sent instead of the default TERM.
-l [exit_status]
If no operand is given, list the signal names; otherwise, write the signal name corresponding to exit_status.
-signal_name
A symbolic signal name specifying the signal to be sent instead of the default TERM.
-signal_number
A non-negative decimal integer, specifying the signal to be sent instead of the default TERM.
The following PIDs have special meanings:
-1 If superuser, broadcast the signal to all processes; otherwise broadcast to all processes belonging to the user.
Some of the more commonly used signals:
1 HUP (hang up)
2 INT (interrupt)
3 QUIT (quit)
6 ABRT (abort)
9 KILL (non-catchable, non-ignorable kill)
14 ALRM (alarm clock)
15 TERM (software termination signal)
Some shells may provide a builtin kill command which is similar or identical to this utility. Consult the builtin(1) manual page.
EXIT STATUS
The kill utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
Terminate the processes with PIDs 142 and 157:
kill 142 157
Send the hangup signal (SIGHUP) to the process with PID 507:
kill -s HUP 507
SEE ALSO
builtin(1), csh(1), killall(1), ps(1), sh(1), kill(2), sigaction(2)
STANDARDS
The kill utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
HISTORY
A kill command appeared in Version 3 AT&T UNIX.
BUGS
A replacement for the command ``kill 0'' for csh(1) users should be provided.
BSD
April 28, 1995 BSD