killall nginx后无法再启动
某次killall nginx后,nginx服务无法再启动。
ps -ef |grep nginx
root 63703 2548 0 14:34 pts/0 00:00:00 grep --color=auto nginx
查看端口,80端口并无其他服务占用:
netstat -lnpt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 3181/mysqld
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2097/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2437/master
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 62906/php-fpm: mast
tcp6 0 0 :::22 :::* LISTEN 2097/sshd
tcp6 0 0 ::1:25 :::* LISTEN 2437/master
然后restart后,Nginx又能正常启动。
/etc/init.d/nginx restart
Restarting nginx (via systemctl): [ 确定 ]
ps -ef |grep nginx
root 63748 1 0 14:36 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nobody 63749 63748 0 14:36 ? 00:00:00 nginx: worker process
nobody 63750 63748 0 14:36 ? 00:00:00 nginx: worker process
root 63752 2548 0 14:36 pts/0 00:00:00 grep --color=auto nginx
端口也成功监听:
netstat -lnpt |grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 63795/nginx: master
总结下来,确认是Nginx非正常停止导致。