安裝linux的寶塔面板,結果面板顯示nginx和php已經運行了,但是機器系統上並沒有運行。記錄一次nginx報錯,操作步驟看下代碼:
[root@localhost nginx]# systemctl status nginx.service ● nginx.service - LSB: starts the nginx web server Loaded: loaded (/etc/rc.d/init.d/nginx; bad; vendor preset: disabled) Active: failed (Result: exit-code) since Mon 2019-07-22 16:41:54 CST; 43s ago Docs: man:systemd-sysv-generator(8) Process: 28076 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=1/FAILURE) Jul 22 16:41:54 localhost.localdomain systemd[1]: Starting LSB: starts the nginx web server... Jul 22 16:41:54 localhost.localdomain nginx[28076]: Starting nginx... nginx (pid 26717 26716 26715 26042) already running. Jul 22 16:41:54 localhost.localdomain systemd[1]: nginx.service: control process exited, code=exited status=1 Jul 22 16:41:54 localhost.localdomain systemd[1]: Failed to start LSB: starts the nginx web server. Jul 22 16:41:54 localhost.localdomain systemd[1]: Unit nginx.service entered failed state. Jul 22 16:41:54 localhost.localdomain systemd[1]: nginx.service failed. [root@localhost nginx]# ps -e | grep nginx ##查看nginx進程 26042 ? 00:00:00 nginx 26715 ? 00:00:00 nginx 26716 ? 00:00:00 nginx 26717 ? 00:00:00 nginx [root@localhost nginx]# kill -9 26042 ###殺死以下進程 [root@localhost nginx]# kill -9 26715 [root@localhost nginx]# kill -9 26716 [root@localhost nginx]# kill -9 26717 [root@localhost nginx]# ps -e | grep nginx ##再次查看已經沒有了 [root@localhost nginx]# [root@localhost nginx]# [root@localhost nginx]# [root@localhost nginx]# systemctl start nginx.service ##啟動服務 [root@localhost nginx]# systemctl status nginx.service ##查看服務 ● nginx.service - LSB: starts the nginx web server Loaded: loaded (/etc/rc.d/init.d/nginx; bad; vendor preset: disabled) Active: active (running) since Mon 2019-07-22 16:43:25 CST; 6s ago Docs: man:systemd-sysv-generator(8) Process: 28116 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=0/SUCCESS) CGroup: /system.slice/nginx.service ├─28123 nginx: master process /www/server/nginx/sbin/nginx -c /www/server/nginx/conf/nginx.conf ├─28124 nginx: worker process ├─28125 nginx: worker process ├─28126 nginx: cache manager process └─28127 nginx: cache loader process Jul 22 16:43:25 localhost.localdomain systemd[1]: Starting LSB: starts the nginx web server... Jul 22 16:43:25 localhost.localdomain nginx[28116]: Starting nginx... done Jul 22 16:43:25 localhost.localdomain systemd[1]: Started LSB: starts the nginx web server. [root@localhost nginx]#
說白了就是進程已經在啟用了,占用進程殺掉重啟服務即可,