前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >nginx基础12

nginx基础12

作者头像
franket
发布2022-05-12 23:08:47
1730
发布2022-05-12 23:08:47
举报
文章被收录于专栏:技术杂记技术杂记
强制停止
代码语言:javascript
复制
[root@h102 logs]# ps faux | grep nginx 
root     11974  0.0  0.0 103256   828 pts/0    S+   15:45   0:00          \_ grep nginx
root     11971  0.0  0.0  24316   680 ?        Ss   15:45   0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nobody   11972  0.0  0.0  24728  1248 ?        S    15:45   0:00  \_ nginx: worker process                                          
[root@h102 logs]# kill -9 11971 
[root@h102 logs]# ps faux | grep nginx 
root     11976  0.0  0.0 103256   828 pts/0    S+   15:45   0:00          \_ grep nginx
nobody   11972  0.0  0.0  24728  1340 ?        S    15:45   0:00 nginx: worker process                                          
[root@h102 logs]#

强制停止比较暴力,会导致worker进程仍然停留在系统中,并且还能被访问


检查配置

重启之前最好先检查一下配置,避免由于配置不合理而导致的服务不可用

代码语言:javascript
复制
[root@h102 nginx]# sbin/nginx -h 
nginx version: nginx/1.9.5
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]

Options:
  -?,-h         : this help
  -v            : show version and exit
  -V            : show version and configure options then exit
  -t            : test configuration and exit
  -T            : test configuration, dump it and exit
  -q            : suppress non-error messages during configuration testing
  -s signal     : send signal to a master process: stop, quit, reopen, reload
  -p prefix     : set prefix path (default: /usr/local/nginx/)
  -c filename   : set configuration file (default: conf/nginx.conf)
  -g directives : set global directives out of configuration file

[root@h102 nginx]# sbin/nginx  -t -c conf/nginx.conf
nginx: [emerg] unexpected end of file, expecting ";" or "}" in /usr/local/nginx/conf/nginx.conf:120
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
[root@h102 nginx]# sbin/nginx  -t -c conf/nginx.conf
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@h102 nginx]#

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 强制停止
  • 检查配置
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档