Linux Server Configuration


Download 493.5 Kb.
bet9/48
Sana16.06.2023
Hajmi493.5 Kb.
#1495871
1   ...   5   6   7   8   9   10   11   12   ...   48
Bog'liq
0501-linux-server-configuration

1.5.4 Signaling Processes


A process can be sent a signal by the kernel or by another process. Each signal is a very simple message: A small whole number with a mnemonic name. Signal names are all-capitals like INT. they are often written with SIG as part of the name for example: SIGINT. There are about 30 signals available not all of which are useful.


The following are the most commonly used signals:





Name

Number

Meaning

INT

2

Interrupt — stop running. Sent by the kernel when
you press Ctrl+C in a terminal.

TERM

15

“Please terminate.” Used to ask a process to exit
gracefully.

KILL

9

“Die!” Forces the process to stop running; it is given
no opportunity to clean up after itself.

TSTP

18

Requests the process to stop itself temporarily. Sent
by the kernel when you press Ctrl+Z in a terminal.

HUP

1

Hang up. Sent by the kernel when we log out, or
disconnect a modem. Conventionally used by many
daemons as an instruction to re-read a configuration
file.

1.5.5 Sending Signals: kill


The kill command is used to send a signal to a process It is a normal executable command, but many shells also provide it as a built-in. For example to send a SIGHUP signal to a process we use either of the following two:


$ kill -HUP pid or


$ kill -s HUP pid

If we omit out the signal name in the kill command, by default kill will send a SIGTERM to the process. We can specify more than one pid to signal multiple processes at the same time.





Download 493.5 Kb.

Do'stlaringiz bilan baham:
1   ...   5   6   7   8   9   10   11   12   ...   48




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling