signal.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 05 Aug 2015 23:55:34 +0300
changeset 1729 22ffd80639c0
parent 1568 efc5ec11da76
permissions -rw-r--r--
Make centered content design with adoption for mobile devices. Highlight TOC.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
391
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
-*- mode: outline; coding: utf-8 -*-
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
* Send signal to process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
  $ kill -s NAME PID
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
Under C you can use kill(2) system call which will send the specified signal
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
to the process, if permissions allow, or raise(3) library function, which
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
sends the specified signal to the current process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
* List of signals.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
  $ kill --list
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
  $ kill -l      # short variant
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
See
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
  http://en.wikipedia.org/wiki/Unix_signals
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
** SIGHUP 1.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    21
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22
Hangup. Type: notification, can be handled.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    23
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    24
Sent when assigned to process terminal closed.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    25
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
nohup(1) utility used as a wrapper to start a program and make it immune to
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
SIGHUP.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
The default action on POSIX-compliant systems is an abnormal termination.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    31
Demon used this signal as commant to reread config file.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    33
** SIGINT 2
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    34
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    35
Interrupt. Ctrl-C. Type: control, can be handled.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    36
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    37
Signal sent to a process by its controlling terminal when a user wishes to
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    38
interrupt the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    39
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    40
By default, this causes the process to terminate.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    41
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    42
** SIGQUIT 3.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    43
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    44
Quit. Ctrl-\. Type: control.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    45
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    46
Signal sent to a process by its controlling terminal when the user requests
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    47
that the process dump core.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    48
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    49
By default, this causes the process to terminate and produce a memory core dump.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    50
1568
efc5ec11da76 Java process and SIGQUIT.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 391
diff changeset
    51
Java dump thread traces to stdout.
efc5ec11da76 Java process and SIGQUIT.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 391
diff changeset
    52
391
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    53
** SIGILL 4.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    54
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    55
Illegal instruction. Type: exception, can not be handled.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    56
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    57
Signal sent to a process when it attempts to execute a malformed, unknown, or
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    58
privileged instruction.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    59
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    60
** SIGTRAP 5.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    61
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    62
Trace trap. Type: debug, can be handled.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    63
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    64
Signal sent to a process when a condition arises that a debugger has requested
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    65
to be informed of.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    66
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    67
By default this causes abnormal termination of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    68
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    69
** SIGABRT 6.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    70
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    71
Type: control, can be handled.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    72
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    73
Signal sent to a computer program to tell it to abort, ie terminate.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    74
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    75
SIGABRT is sent by the process to itself when it calls the abort libc
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    76
function. It is used when an assertion fails.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    77
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    78
By default this causes abnormal termination of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    79
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    80
** SIGEMT 7.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    81
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    82
Emt instruction.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    83
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    84
** SIGFPE 8.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    85
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    86
Floating point exception. Type: exception, can be handled.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    87
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    88
Signal sent to a process when it performs an erroneous arithmetic operation
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    89
(like division by zero).
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    90
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    91
By default cause a core dump and a program exit.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    92
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    93
** SIGKILL 9.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    94
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    95
Kill. Type: control, can not be handled.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    96
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    97
Signal sent to a process to cause it to terminate immediately.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    98
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    99
Zombie processes cannot be killed since they are already dead and waiting for
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   100
their parent processes to reap them.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   101
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   102
Processes that are in the blocked state will not die until they wake up again.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   103
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   104
** SIGBUS 10.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   105
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   106
Bus error. Type: exception, can not be handled.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   107
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   108
Signal sent to a process when it causes a bus error.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   109
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   110
By default this causes abnormal termination of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   111
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   112
** SIGSEGV 11.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   113
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   114
Segmentation violation. Type: exception.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   115
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   116
Signal sent to a process when it makes an invalid memory reference, or
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   117
segmentation fault.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   118
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   119
By default cause a core dump and a program exit.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   120
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   121
** SIGSYS 12.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   122
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   123
Bad argument to system call. Type: exception.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   124
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   125
By default this causes abnormal termination of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   126
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   127
** SIGPIPE 13.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   128
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   129
Write on a pipe with no one to read it. Type: notification.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   130
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   131
Signal sent to a process when it attempts to write to a pipe without a process
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   132
connected to the other end.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   133
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   134
This causes the process to terminate, which is convenient when constructing
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   135
shell pipelines.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   136
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   137
** SIGALRM 14.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   138
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   139
Alarm clock. Type: notification.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   140
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   141
Signal sent to a process when a time limit has elapsed.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   142
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   143
By default this causes abnormal termination of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   144
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   145
** SIGTERM 15.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   146
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   147
Software termination signal. Type: control.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   148
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   149
Signal sent to a process to request its termination.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   150
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   151
It causes the termination of a process, but unlike the SIGKILL signal, it can
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   152
be caught and interpreted (or ignored) by the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   153
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   154
SIGTERM is akin to asking a process to terminate nicely, allowing cleanup and
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   155
closure of files. For this reason, on many Unix systems during shutdown, init
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   156
issues SIGTERM to all processes that are not essential to powering off, waits
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   157
a few seconds, and then issues SIGKILL to forcibly terminate any such
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   158
processes that remain.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   159
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   160
By default kill(1) send to process SIGTERM signal.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   161
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   162
** SIGURG 16.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   163
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   164
Urgent condition on IO channel. Type: notification.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   165
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   166
By default this signal ignored.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   167
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   168
** SIGSTOP 17.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   169
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   170
Signal sent to a process to stop it for later resumption. Type: control.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   171
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   172
SIGSTOP cannot be caught or ignored.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   173
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   174
Usually SIGSTOP and SIGCONT are used for job control in the Unix shell.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   175
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   176
** SIGTSTP 18.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   177
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   178
Stop signal from tty. Ctrl-Z. Type: control.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   179
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   180
By default, this causes the process to suspend execution.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   181
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   182
** SIGCONT 19.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   183
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   184
Continue a stopped process. Type: control.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   185
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   186
Signal sent to restart a process previously paused by the SIGSTOP or SIGTSTP
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   187
signal.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   188
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   189
** SIGCHLD 20.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   190
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   191
To parent on child stop or exit. Type: notification.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   192
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   193
By default the signal is simply ignored. In C:
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   194
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   195
  signal(SIGCHLD, SIG_IGN);
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   196
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   197
Parent can invoke wait(1) otherwise children stay zombie.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   198
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   199
** SIGTTIN 21.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   200
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   201
Signal sent to a process when it attempts to read from the tty while in the
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   202
background.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   203
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   204
Daemons do not have controlling terminals and should never receive this
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   205
signal.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   206
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   207
By default this causes suspends of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   208
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   209
** SIGTTOU 22.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   210
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   211
Signal sent to a process when it attempts to write to the tty while in the
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   212
background.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   213
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   214
Daemons do not have controlling terminals and should never receive this
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   215
signal.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   216
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   217
By default this causes suspends of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   218
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   219
** SIGPOLL 23.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   220
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   221
System V name for SIGIO. Type: notification.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   222
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   223
Signal sent to a process when an asynchronous I/O event occurs.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   224
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   225
By default this causes abnormal termination of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   226
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   227
** SIGXCPU 24.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   228
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   229
Exceeded CPU time limit. Type: notification.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   230
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   231
By default this causes abnormal termination of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   232
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   233
** SIGXFSZ 25.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   234
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   235
Exceeded file size limit as determined by the ulimit system call and shell
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   236
builtin. Type: notification.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   237
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   238
By default this causes abnormal termination of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   239
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   240
** SIGVTALRM 26.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   241
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   242
Virtual time alarm. Type: notification.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   243
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   244
Signal sent to a process when a time limit has elapsed.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   245
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   246
By default this causes abnormal termination of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   247
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   248
** SIGPROF 27.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   249
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   250
Profiling time alarm. Type: debug.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   251
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   252
Signal sent to a process when the profiling timer expires.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   253
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   254
By default this causes abnormal termination of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   255
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   256
** SIGWINCH 28.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   257
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   258
Window changed. Type: notification.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   259
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   260
Signal sent to a process when its controlling terminal changes size.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   261
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   262
By default this signal ignored.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   263
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   264
** SIGLOST 29.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   265
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   266
Signal sent to process when a file lock is lost. This may occur, for example,
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   267
when an NFS server reboots and forgets about a file lock.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   268
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   269
By default this causes abnormal termination of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   270
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   271
** SIGUSR1 30.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   272
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   273
User defined signal 1. Type: user defined.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   274
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   275
By default this causes abnormal termination of the process.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   276
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   277
** SIGUSR2 31.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   278
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   279
User defined signal 2. Type: user defined.
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   280
99698e5d7b63 About POSIX signals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   281
By default this causes abnormal termination of the process.