为什么我的 VPS 显示我的 nginx 状态为已死亡、已禁用、错误阻止 UFW,但网站仍然处于运行状态?

为什么我的 VPS 显示我的 nginx 状态为已死亡、已禁用、错误阻止 UFW,但网站仍然处于运行状态?

我自己可以针对 nginx 服务执行任何命令。但是 pid 仍然在 /run/nginx.pid :-D,这表明该进程正在运行,我仍然可以访问网站。但死亡服务是可怕和安静的,我甚至不需要说,如果我需要重新启动 nginx,我将无法做到,因为我不能!

我非常感谢你的帮助。

systemctl 状态 nginx:

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
root@vps1:~# /etc/init.d/nginx status
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2018-08-23 12:31:26 WEST; 10h ago
  Process: 29455 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=1/FAILURE)
  Process: 30170 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 30167 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 4178 (code=exited, status=0/SUCCESS)

journalctl-xe

Aug 23 22:51:18 vps1 saslauthd[1550]: do_auth         : auth failure: [[email protected]] [service=smtp] [realm=vps.FQDN
Aug 23 22:51:18 vps1 postfix/smtpd[32123]: warning: unknown[181.214.206.123]: SASL LOGIN authentication failed: authentication failure
Aug 23 22:51:19 vps1 postfix/smtpd[32123]: disconnect from unknown[181.214.206.123] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Aug 23 22:51:23 vps1 kernel: [UFW BLOCK] IN=ens3 OUT= MAC=fa:21:2:d33:97:51a:d74:a4:24:01:ef:61:03:00 SRC=124.16.131.250 DST=100.47.84.180 LEN=60 T
Aug 23 22:51:25 vps1 kernel: [UFW BLOCK] IN=ens3 OUT= MAC=fa:21:2:d33:97:51a:d74:a4:24:01:ef:61:03:00 SRC=78.128.112.18 DST=100.47.84.180 LEN=40 TO
Aug 23 22:51:25 vps1 systemd[1]: Starting A high performance web server and a reverse proxy server...
-- Subject: Unit nginx.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nginx.service has begun starting up.
Aug 23 22:51:25 vps1 nginx[3310]: nginx: [emerg] bind() to 100.47.84.180:80 failed (98: Address already in use)
Aug 23 22:51:25 vps1 nginx[3310]: nginx: [emerg] bind() to 100.47.84.180:443 failed (98: Address already in use)
Aug 23 22:51:26 vps1 kernel: [UFW BLOCK] IN=ens3 OUT= MAC=fa:21:2:d33:97:51a:d74:a4:24:01:ef:61:03:00 SRC=82.221.105.7 DST=100.47.84.180 LEN=44 TOS
Aug 23 22:51:26 vps1 nginx[3310]: nginx: [emerg] bind() to 100.47.84.180:80 failed (98: Address already in use)
Aug 23 22:51:26 vps1 nginx[3310]: nginx: [emerg] bind() to 100.47.84.180:443 failed (98: Address already in use)
Aug 23 22:51:26 vps1 nginx[3310]: nginx: [emerg] bind() to 100.47.84.180:80 failed (98: Address already in use)
Aug 23 22:51:26 vps1 nginx[3310]: nginx: [emerg] bind() to 100.47.84.180:443 failed (98: Address already in use)
Aug 23 22:51:27 vps1 kernel: [UFW BLOCK] IN=ens3 OUT= MAC=fa:21:2:d33:97:51a:d74:a4:24:01:ef:61:03:00 SRC=124.16.131.250 DST=100.47.84.180 LEN=60 T

猫/var/log/nginx/error.log

2018/08/23 12:26:41 [emerg] 29481#29481: invalid number of arguments in "fastcgi_pass" directive in /etc/nginx/sites-enabled/mydomain.com.conf:32
2018/08/23 12:31:24 [emerg] 30170#30170: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:31:24 [emerg] 30170#30170: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:31:24 [emerg] 30170#30170: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:31:24 [emerg] 30170#30170: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:31:24 [emerg] 30170#30170: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:31:24 [emerg] 30170#30170: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:31:24 [emerg] 30170#30170: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:31:24 [emerg] 30170#30170: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:31:24 [emerg] 30170#30170: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:31:24 [emerg] 30170#30170: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:31:24 [emerg] 30170#30170: still could not bind()
2018/08/23 12:32:11 [emerg] 30262#30262: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:32:11 [emerg] 30262#30262: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:32:11 [emerg] 30262#30262: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:32:11 [emerg] 30262#30262: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:32:11 [emerg] 30262#30262: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:32:11 [emerg] 30262#30262: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:32:11 [emerg] 30262#30262: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:32:11 [emerg] 30262#30262: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:32:11 [emerg] 30262#30262: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:32:11 [emerg] 30262#30262: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:32:11 [emerg] 30262#30262: still could not bind()
2018/08/23 12:34:43 [emerg] 31749#31749: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:34:43 [emerg] 31749#31749: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:34:43 [emerg] 31749#31749: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:34:43 [emerg] 31749#31749: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:34:43 [emerg] 31749#31749: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:34:43 [emerg] 31749#31749: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:34:43 [emerg] 31749#31749: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:34:43 [emerg] 31749#31749: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:34:43 [emerg] 31749#31749: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 12:34:43 [emerg] 31749#31749: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 12:34:43 [emerg] 31749#31749: still could not bind()
2018/08/23 21:44:39 [emerg] 31550#31550: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:44:39 [emerg] 31550#31550: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:44:39 [emerg] 31550#31550: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:44:39 [emerg] 31550#31550: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:44:39 [emerg] 31550#31550: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:44:39 [emerg] 31550#31550: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:44:39 [emerg] 31550#31550: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:44:39 [emerg] 31550#31550: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:44:39 [emerg] 31550#31550: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:44:39 [emerg] 31550#31550: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:44:39 [emerg] 31550#31550: still could not bind()
2018/08/23 21:47:10 [emerg] 31757#31757: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:47:10 [emerg] 31757#31757: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:47:10 [emerg] 31757#31757: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:47:10 [emerg] 31757#31757: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:47:10 [emerg] 31757#31757: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:47:10 [emerg] 31757#31757: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:47:10 [emerg] 31757#31757: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:47:10 [emerg] 31757#31757: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:47:10 [emerg] 31757#31757: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:47:10 [emerg] 31757#31757: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:47:10 [emerg] 31757#31757: still could not bind()
2018/08/23 21:49:41 [emerg] 31874#31874: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:49:41 [emerg] 31874#31874: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:49:41 [emerg] 31874#31874: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:49:41 [emerg] 31874#31874: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:49:41 [emerg] 31874#31874: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:49:41 [emerg] 31874#31874: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:49:41 [emerg] 31874#31874: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:49:41 [emerg] 31874#31874: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:49:41 [emerg] 31874#31874: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:49:41 [emerg] 31874#31874: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:49:41 [emerg] 31874#31874: still could not bind()
2018/08/23 21:52:11 [emerg] 32122#32122: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:52:11 [emerg] 32122#32122: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:52:11 [emerg] 32122#32122: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:52:11 [emerg] 32122#32122: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:52:11 [emerg] 32122#32122: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:52:11 [emerg] 32122#32122: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:52:11 [emerg] 32122#32122: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:52:11 [emerg] 32122#32122: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:52:11 [emerg] 32122#32122: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:52:11 [emerg] 32122#32122: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:52:11 [emerg] 32122#32122: still could not bind()
2018/08/23 21:54:42 [emerg] 32204#32204: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:54:42 [emerg] 32204#32204: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:54:42 [emerg] 32204#32204: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:54:42 [emerg] 32204#32204: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:54:42 [emerg] 32204#32204: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:54:42 [emerg] 32204#32204: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:54:42 [emerg] 32204#32204: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:54:42 [emerg] 32204#32204: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:54:42 [emerg] 32204#32204: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 21:54:42 [emerg] 32204#32204: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 21:54:42 [emerg] 32204#32204: still could not bind()
2018/08/23 22:51:25 [emerg] 3310#3310: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 22:51:25 [emerg] 3310#3310: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 22:51:25 [emerg] 3310#3310: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 22:51:25 [emerg] 3310#3310: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 22:51:25 [emerg] 3310#3310: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 22:51:25 [emerg] 3310#3310: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 22:51:25 [emerg] 3310#3310: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 22:51:25 [emerg] 3310#3310: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 22:51:25 [emerg] 3310#3310: bind() to 54.71.93.142:80 failed (98: Address already in use)
2018/08/23 22:51:25 [emerg] 3310#3310: bind() to 54.71.93.142:443 failed (98: Address already in use)
2018/08/23 22:51:25 [emerg] 3310#3310: still could not bind()

答案1

您手动启动了 nginx,不在 systemd 中。这就是 systemd 无法再次启动它的原因。您只需终止手动启动的 nginx,然后就可以正常重启服务。

相关内容