<s>
On	O
POSIX-compliant	O
platforms	O
,	O
SIGHUP	O
(	O
"	O
signal	B-Operating_System
hang	O
up	O
"	O
)	O
is	O
a	O
signal	B-Operating_System
sent	O
to	O
a	O
process	B-Operating_System
when	O
its	O
controlling	O
terminal	B-General_Concept
is	O
closed	O
.	O
</s>
<s>
It	O
was	O
originally	O
designed	O
to	O
notify	O
the	O
process	B-Operating_System
of	O
a	O
serial	O
line	O
drop	O
.	O
</s>
<s>
SIGHUP	O
is	O
a	O
symbolic	B-Language
constant	I-Language
defined	O
in	O
the	O
header	B-Language
file	I-Language
signal.h.	O
</s>
<s>
Access	O
to	O
computer	B-Architecture
systems	I-Architecture
for	O
many	O
years	O
consisted	O
of	O
connecting	O
a	O
terminal	B-General_Concept
to	O
a	O
mainframe	B-Architecture
system	O
via	O
a	O
serial	O
line	O
and	O
the	O
RS-232	O
protocol	O
.	O
</s>
<s>
When	O
a	O
system	O
of	O
software	O
interrupts	B-Application
,	O
called	O
signals	O
,	O
was	O
being	O
developed	O
,	O
one	O
of	O
those	O
signals	O
was	O
designated	O
for	O
use	O
on	O
hangup	O
.	O
</s>
<s>
SIGHUP	O
would	O
be	O
sent	O
to	O
programs	B-Application
when	O
the	O
serial	O
line	O
was	O
dropped	O
,	O
often	O
because	O
the	O
connected	O
user	O
terminated	O
the	O
connection	O
by	O
hanging	O
up	O
the	O
modem	B-Application
.	O
</s>
<s>
The	O
system	O
would	O
detect	O
the	O
line	O
was	O
dropped	O
via	O
the	O
lost	O
Data	O
Carrier	O
Detect	O
(	O
DCD	O
)	O
signal	B-Operating_System
.	O
</s>
<s>
Signals	O
have	O
always	O
been	O
a	O
convenient	O
method	O
of	O
inter-process	B-Operating_System
communication	I-Operating_System
(	O
IPC	O
)	O
,	O
but	O
in	O
early	O
implementations	O
there	O
were	O
no	O
user-definable	O
signals	O
(	O
such	O
as	O
the	O
later	O
additions	O
of	O
SIGUSR1	O
and	O
SIGUSR2	O
)	O
that	O
programs	B-Application
could	O
intercept	O
and	O
interpret	O
for	O
their	O
own	O
purposes	O
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
applications	O
that	O
did	O
not	O
require	O
a	O
controlling	O
terminal	B-General_Concept
,	O
such	O
as	O
daemons	B-Operating_System
,	O
would	O
re-purpose	O
SIGHUP	O
as	O
a	O
signal	B-Operating_System
to	O
re-read	O
configuration	B-Protocol
files	I-Protocol
,	O
or	O
reinitialize	O
.	O
</s>
<s>
This	O
convention	O
survives	O
to	O
this	O
day	O
in	O
packages	O
such	O
as	O
Apache	B-Application
and	O
Sendmail	B-Application
.	O
</s>
<s>
With	O
the	O
decline	O
of	O
access	O
via	O
serial	O
line	O
,	O
the	O
meaning	O
of	O
SIGHUP	O
has	O
changed	O
somewhat	O
on	O
modern	O
systems	O
,	O
often	O
meaning	O
a	O
controlling	O
pseudo	B-Application
or	I-Application
virtual	I-Application
terminal	I-Application
has	O
been	O
closed	O
.	O
</s>
<s>
If	O
a	O
command	O
is	O
executed	O
inside	O
a	O
terminal	B-Application
window	I-Application
and	O
the	O
terminal	B-Application
window	I-Application
is	O
closed	O
while	O
the	O
command	O
process	B-Operating_System
is	O
still	O
running	O
,	O
it	O
receives	O
SIGHUP	O
.	O
</s>
<s>
If	O
the	O
process	B-Operating_System
receiving	O
SIGHUP	O
is	O
a	O
Unix	B-Application
shell	I-Application
,	O
then	O
as	O
part	O
of	O
job	B-Operating_System
control	I-Operating_System
it	O
will	O
often	O
intercept	O
the	O
signal	B-Operating_System
and	O
ensure	O
that	O
all	O
stopped	O
processes	O
are	O
continued	O
before	O
sending	O
the	O
signal	B-Operating_System
to	O
child	O
processes	O
(	O
more	O
precisely	O
,	O
process	B-Operating_System
groups	I-Operating_System
,	O
represented	O
internally	O
by	O
the	O
shell	O
as	O
a	O
"	O
job	O
"	O
)	O
,	O
which	O
by	O
default	O
terminates	O
them	O
.	O
</s>
<s>
Firstly	O
,	O
the	O
Single	O
UNIX	O
Specification	O
describes	O
a	O
shell	O
utility	O
called	O
nohup	B-Device
,	O
which	O
can	O
be	O
used	O
as	O
a	O
wrapper	O
to	O
start	O
a	O
program	O
and	O
make	O
it	O
ignore	O
SIGHUP	O
by	O
default	O
.	O
</s>
<s>
Secondly	O
,	O
child	O
process	B-Operating_System
groups	I-Operating_System
can	O
be	O
"	O
disowned	O
"	O
by	O
invoking	O
disown	B-Application
with	O
the	O
job	O
id	O
,	O
which	O
removes	O
the	O
process	B-Operating_System
group	I-Operating_System
from	O
the	O
shell	O
's	O
job	O
table	O
(	O
so	O
they	O
will	O
not	O
be	O
sent	O
SIGHUP	O
)	O
,	O
or	O
(	O
optionally	O
)	O
keeps	O
them	O
in	O
the	O
job	O
table	O
but	O
prevents	O
them	O
from	O
receiving	O
SIGHUP	O
on	O
shell	O
termination	O
.	O
</s>
<s>
Different	O
shells	O
also	O
have	O
other	O
methods	O
of	O
controlling	O
and	O
managing	O
SIGHUP	O
,	O
such	O
as	O
the	O
disown	B-Application
facility	O
of	O
ksh	B-Language
.	O
</s>
<s>
Most	O
modern	O
Linux	B-Application
distributions	I-Application
documentation	O
specify	O
using	O
kill	B-Operating_System
-HUP	O
<processID>	O
to	O
send	O
the	O
SIGHUP	O
signal	B-Operating_System
.	O
</s>
<s>
Daemon	B-Operating_System
programs	B-Application
sometimes	O
use	O
SIGHUP	O
as	O
a	O
signal	B-Operating_System
to	O
restart	O
themselves	O
,	O
the	O
most	O
common	O
reason	O
for	O
this	O
being	O
to	O
re-read	O
a	O
configuration	B-Protocol
file	I-Protocol
that	O
has	O
been	O
changed	O
.	O
</s>
<s>
Symbolic	O
signal	B-Operating_System
names	O
are	O
used	O
because	O
signal	B-Operating_System
numbers	O
can	O
vary	O
across	O
platforms	O
,	O
but	O
XSI-conformant	O
systems	O
allow	O
the	O
use	O
of	O
the	O
numeric	O
constant	O
1	O
to	O
be	O
used	O
to	O
indicate	O
a	O
SIGHUP	O
,	O
which	O
the	O
vast	O
majority	O
of	O
systems	O
in	O
fact	O
use	O
.	O
</s>
<s>
That	O
is	O
,	O
programmers	B-Application
can	O
define	O
the	O
action	O
they	O
want	O
to	O
occur	O
upon	O
receiving	O
a	O
SIGHUP	O
,	O
such	O
as	O
calling	O
a	O
function	O
,	O
ignoring	O
it	O
,	O
or	O
restoring	O
the	O
default	O
action	O
.	O
</s>
