信號(hào)控制與進(jìn)程管理
信號(hào) | 作用 |
---|---|
TERM, INT | Quick shutdown |
QUIT | Graceful shutdown 優(yōu)雅的關(guān)閉進(jìn)程,即等請(qǐng)求結(jié)束后再關(guān)閉 |
HUP | Configuration reload ,Start the new worker processes with a new configuration Gracefully shutdown the old worker processes改變配置文件,平滑的重讀配置文件 |
USR1 | Reopen the log files 重讀日志,在日志按月/日分割時(shí)有用 |
USR2 | Upgrade Executable on the fly 平滑的升級(jí) |
WINCH | Gracefully shutdown the worker processes 優(yōu)雅關(guān)閉舊的進(jìn)程(配合USR2來(lái)進(jìn)行升級(jí)) |
具體語(yǔ)法:
Kill -信號(hào)選項(xiàng) nginx的主進(jìn)程號(hào)
Kill -HUP 4873
Kill -信號(hào)控制 cat /xxx/path/log/nginx.pid
Kil; -USR1 cat /xxx/path/log/nginx.pid
進(jìn)程:
主進(jìn)程:管理子進(jìn)程
子進(jìn)程:響應(yīng)請(qǐng)求