zoukankan      html  css  js  c++  java
  • nginx 信号管理

    本内容只针对nginx 关闭操作罗列方法技巧,不废话直接写,Nginx的信号控制如下:


    1. TERM, INT 强制关闭进程

       查看nginx进程ps -aux|grep nginx
       root  8646  0.0  0.0  24844   768 ?  Ss 15:14  0:00 nginx: master process /usr/local/nginx/sbin/nginx
       nobody 8647  0.0  0.1  25256  1724 ?  S  15:14  0:00 nginx: worker process
       root   8674 0.0  0.0 112660 968 pts/3  R+   15:16   0:00 grep --color=auto nginx

       kill -INT  8646 表示强制关闭进程

     2. QUIT  优雅的关闭进程,即等请求结束后再关闭

      
        查看nginx进程ps -aux|grep nginx
        root  8646  0.0  0.0  24844   768 ?  Ss 15:14  0:00 nginx: master process /usr/local/nginx/sbin/nginx
        nobody 8647  0.0  0.1  25256  1724 ?  S  15:14  0:00 nginx: worker process
        root   8674 0.0  0.0 112660 968 pts/3  R+   15:16   0:00 grep --color=auto nginx

        kill -QUIT 8646  表示等请求结束后再关闭
     

     3. HUP 改变配置文件,平滑的重读配置文件

        查看nginx进程ps -aux|grep nginx
         root  8646  0.0  0.0  24844   768 ?  Ss 15:14  0:00 nginx: master process /usr/local/nginx/sbin/nginx
         nobody 8647  0.0  0.1  25256  1724 ?  S  15:14  0:00 nginx: worker process
         root   8674 0.0  0.0 112660 968 pts/3  R+   15:16   0:00 grep --color=auto nginx

         kill -HUP 8646  软重启,重加载文件

     4. USR1 重读日志

        查看nginx进程ps -aux|grep nginx
       root  8646  0.0  0.0  24844   768 ?  Ss 15:14  0:00 nginx: master process /usr/local/nginx/sbin/nginx
       nobody 8647  0.0  0.1  25256  1724 ?  S  15:14  0:00 nginx: worker process
       root   8674 0.0  0.0 112660 968 pts/3  R+   15:16   0:00 grep --color=auto nginx


             kill -USR1 8646  重读日志  

  • 相关阅读:
    [二分][dp] Jzoj P3463 军训
    [树状数组] Jzoj P3462 休息
    [期望] Jzoj P3459 TheSwaps
    [dp] Jzoj P3460 Mixing Chemicals
    [数位dp][状压dp] Jzoj P3458 密码
    [匈牙利] Jzoj P1156 使命的召唤
    [bfs][状压] Jzoj P2121 分球
    [dp] Jzoj P1187 最大公共子串
    [树套树] Jzoj P5699 【gdoi2018 day1】涛涛接苹果
    [枚举] Jzoj P3387 终极武器
  • 原文地址:https://www.cnblogs.com/M87-A/p/11208265.html
Copyright © 2011-2022 走看看