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  重读日志  

  • 相关阅读:
    Autofac ASP.NET Web API (Beta) Integration
    An Autofac Lifetime Primer
    Web api help page error CS0012: Type "System.Collections.Generic.Dictionary'2错误
    c++ 全局变量初始化的一点总结
    C++中extern关键字用法小结
    为什么多线程读写 shared_ptr 要加锁?
    CentOS7 安装Chrome
    在CentOS 7中使用VS Code编译调试C++项目
    am335x hid-multitouch.c
    implicit declaration of function 'copy_from_user'
  • 原文地址:https://www.cnblogs.com/M87-A/p/11208265.html
Copyright © 2011-2022 走看看