AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 991354
Accepted
Marc
Marc
Asked: 2019-11-12 04:16:39 +0800 CST2019-11-12 04:16:39 +0800 CST 2019-11-12 04:16:39 +0800 CST

无法停止 nginx 服务

  • 772

我们在 systemd 中运行了 nginx(在端口 8080 上),CentOS 7.7但无法停止它 - 没有错误,它只是继续运行或重生。

我们已经尝试过sudo systemctl stop,sudo systemctl disable甚至尝试过,kill但它一直在运行。

Nov 11 13:04:18 myhost systemd[1]: Started The Gateway - Nginx.
[myuser@myhost gateway]$ sudo systemctl stop gateway
[myuser@myhost gateway]$ sudo systemctl status gateway
gateway.service - The Gateway - Nginx
   Loaded: loaded (/usr/lib/systemd/system/gateway.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Mon 2019-11-11 13:04:18 CET; 6min ago
  Process: 20988 ExecStart=/usr/sbin/nginx -c /prg/nginx/conf/gateway.conf (code=exited, status=0/SUCCESS)
  Process: 20985 ExecStartPre=/usr/sbin/nginx -t -c /prg/nginx/conf/gateway.conf (code=exited, status=0/SUCCESS)
  Process: 20983 ExecStartPre=/usr/bin/rm -f /daten/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 20988 (code=exited, status=0/SUCCESS)
    Tasks: 2
   Memory: 1.6M
   CGroup: /system.slice/gateway.service
           ├─20990 nginx: master process /usr/sbin/nginx -c /prg/nginx/conf/gateway.conf
           └─20991 nginx: worker process

Nov 11 13:04:18 myhost systemd[1]: Starting The Gateway - Nginx...
Nov 11 13:04:18 myhost node-gateway[20985]: nginx: the configuration file /prg/nginx/conf/gateway.conf syntax is ok
Nov 11 13:04:18 myhost node-gateway[20985]: nginx: configuration file /prg/nginx/conf/gateway.conf test is successful
Nov 11 13:04:18 myhost systemd[1]: Started The Gateway - Nginx.

禁用并停止

[myuser@myhost gateway]$ sudo systemctl disable gateway
Removed symlink /etc/systemd/system/multi-user.target.wants/gateway.service.
[myuser@myhost gateway]$ sudo systemctl stop gateway

仍在运行

[myuser@myhost gateway]$ sudo systemctl status gateway
gateway.service - The Gateway - Nginx
   Loaded: loaded (/usr/lib/systemd/system/gateway.service; disabled; vendor preset: disabled)
   Active: inactive (dead) since Mon 2019-11-11 13:04:18 CET; 6min ago
 Main PID: 20988 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/gateway.service
           ├─20990 nginx: master process /usr/sbin/nginx -c /prg/nginx/conf/gateway.conf
           └─20991 nginx: worker process

Nov 11 13:04:18 myhost systemd[1]: Starting The Gateway - Nginx...
Nov 11 13:04:18 myhost node-gateway[20985]: nginx: the configuration file /prg/nginx/conf/gateway.conf syntax is ok
Nov 11 13:04:18 myhost node-gateway[20985]: nginx: configuration file /prg/nginx/conf/gateway.conf test is successful
Nov 11 13:04:18 myhost systemd[1]: Started The Gateway - Nginx.
[myuser@myhost gateway]$ ps -auxf | grep nginx
myuser    21846  0.0  0.0 112684   696 pts/0    S+   13:11   0:00  |           \_ grep --color=auto nginx
root      20990  0.0  0.0  59080  1388 ?        Ss   13:04   0:00 nginx: master process /usr/sbin/nginx -c /prg/nginx/conf/gateway.conf
nginx     20991  0.0  0.0  61272  2708 ?        S    13:04   0:00  \_ nginx: worker process
[myuser@myhost gateway]$ sudo lsof -i -P -n | grep 8080
node       1313              root   20u  IPv4 429747      0t0  TCP 127.0.0.1:51580->127.0.0.1:8080 (ESTABLISHED)
node       1313              root   21u  IPv4 432203      0t0  TCP 127.0.0.1:51640->127.0.0.1:8080 (ESTABLISHED)
node       1316 serviceuser   19u  IPv4 332198      0t0  TCP 172.25.24.45:57328->172.25.24.20:8080 (ESTABLISHED)
node       1316 serviceuser   21u  IPv4 318233      0t0  TCP 172.25.24.45:57260->172.25.24.20:8080 (ESTABLISHED)
nginx     20990              root    6u  IPv4 430360      0t0  TCP *:8080 (LISTEN)
nginx     20991             nginx    3u  IPv4 430473      0t0  TCP 127.0.0.1:8080->127.0.0.1:51580 (ESTABLISHED)
nginx     20991             nginx    6u  IPv4 430360      0t0  TCP *:8080 (LISTEN)
nginx     20991             nginx   25u  IPv4 432204      0t0  TCP 127.0.0.1:8080->127.0.0.1:51640 (ESTABLISHED)
nginx
  • 1 1 个回答
  • 1692 Views

1 个回答

  • Voted
  1. Best Answer
    Nakkisormi
    2019-11-12T04:18:36+08:002019-11-12T04:18:36+08:00
     Active: inactive (dead) since Mon 2019-11-11 13:04:18 CET; 6min ago
    

    对我来说它看起来不活跃(=死了,停止了,不管你怎么称呼它)?

    编辑:似乎这个过程可能仍然存在:

    root      20990  0.0  0.0  59080  1388 ?        Ss   13:04   0:00 nginx: master process /usr/sbin/nginx -c /prg/nginx/conf/gateway.con
    

    您可以尝试使用 kill 命令手动杀死它,如果 SIGTERM 不起作用,请尝试 SIGKILL

    kill -SIGTERM <process id, 20990 in this case>
    
    • 1

相关问题

  • Gzip 与反向代理缓存

  • nginx 作为代理的行为

  • Nginx 学习资源 [关闭]

  • 提供 70,000 个静态文件 (jpg) 的最佳方式?

  • 在 Apache、LightTPD 和 Nginx Web 服务器上提供 PHP 5.x 应用程序的现状?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve