새로 구입한 서버에 CentOS 8과 최신 Nginx가 설치되어 있습니다.
Nginx를 중지하려고 합니다.
[root@mymachine run]# nginx -s stop
nginx: [error] invalid PID number "" in "/run/nginx.pid"
작동 안함.
네트워크는 여전히 작동합니다. curl -I http://mysite.com
다음을 사용하여 출력을 볼 수 있습니다 .
HTTP/1.1 200 OK
Server: nginx/1.14.1
많은 프로세스를 찾았습니다.
[root@mymachine run]# ps -aux | grep "nginx"
root 22584 0.0 0.1 156164 11292 ? S Sep17 0:03 nginx: worker process
root 22585 0.0 0.1 155836 10832 ? S Sep17 0:00 nginx: worker process
root 22586 0.0 0.1 155836 9348 ? S Sep17 0:00 nginx: worker process
root 22587 0.0 0.1 155836 9348 ? S Sep17 0:00 nginx: worker process
root 22588 0.0 0.1 155836 9348 ? S Sep17 0:00 nginx: worker process
root 22589 0.0 0.1 155836 9348 ? S Sep17 0:00 nginx: worker process
root 22590 0.0 0.1 155836 9348 ? S Sep17 0:00 nginx: worker process
root 22591 0.0 0.1 155836 9348 ? S Sep17 0:00 nginx: worker process
root 22592 0.0 0.1 155836 9144 ? S Sep17 0:00 nginx: cache manager process
root 26125 0.0 0.0 12108 1080 pts/0 S+ 09:11 0:00 grep --color=auto nginx
nginx를 완전히 종료하려면 어떻게 해야 하나요?
왜 이런 일이 발생합니까?
업데이트됨systemctl 상태 nginx.service결과:
[root@mymachine ~]# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2020-09-18 09:34:52 CST; 20min ago
Process: 1868 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
Process: 1865 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 1862 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Sep 18 09:34:51 mymachine nginx[1868]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Sep 18 09:34:51 mymachine nginx[1868]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Sep 18 09:34:51 mymachine nginx[1868]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Sep 18 09:34:51 mymachine nginx[1868]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Sep 18 09:34:52 mymachine nginx[1868]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Sep 18 09:34:52 mymachine nginx[1868]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Sep 18 09:34:52 mymachine nginx[1868]: nginx: [emerg] still could not bind()
Sep 18 09:34:52 mymachine systemd[1]: nginx.service: Control process exited, code=exited status=1
Sep 18 09:34:52 mymachine systemd[1]: nginx.service: Failed with result 'exit-code'.
Sep 18 09:34:52 mymachine systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
감사해요