Book Image

Nginx Essentials

By : Valery Kholodkov, Valery I Kholodkov
Book Image

Nginx Essentials

By: Valery Kholodkov, Valery I Kholodkov

Overview of this book

Table of Contents (13 chapters)

Control signals and their usage


Nginx, like any other Unix background service, is controlled by signals. Signals are asynchronous events that interrupt normal execution of a process and activate certain functions. The following table lists all signals that Nginx supports and the functions that they trigger:

Signal

Function

TERM, INT

Fast shutdown

QUIT

Graceful shutdown

HUP

Reconfiguration

USR1

Log file reopening

USR2

Nginx binary upgrade

WINCH

Graceful worker shutdown

All signals must be sent to the master process of an instance. The master process of an instance can be located by looking it up in the process list:

# ps -C nginx -f
UID        PID  PPID  C STIME TTY          TIME CMD
root      4754  3201  0 11:10 ?        00:00:00 nginx: master process /usr/sbin/nginx
www-data  4755  4754  0 11:10 ?        00:00:00 nginx: worker process
www-data  4756  4754  0 11:10 ?        00:00:00 nginx: worker process
www-data  4757  4754  0 11:10 ?        00:00:00 nginx: worker...