1. 程式人生 > >nginx提示Job for nginx.service failed because the control的問題

nginx提示Job for nginx.service failed because the control的問題

proc 你是 pro 柯南 修改 exit 目錄 rest systemctl

啟動nginx時就報錯!
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

墻內外找了一圈找了一圈終於還是在墻外找到答案了。。

現在假設你是這樣操作的:
你修改了/etc/nginx/conf.d/default.conf文件,興高采烈的保存了,然後興高采烈的運行了systemctl restart nginx.service
結果 (╯‵□′)╯︵┻━┻,出現了Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.


心兒哇涼的你搜索了Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
按照首頁的很多辦法試圖解決,都失敗了,你有點悲痛欲絕了,直到看到這個問題下的采納答案,你仿佛看到了希望,於是你搜索了/usr/lib/systemd/system 目錄下的nginx.service ,找到了。。看來這個答案也沒能幫到你,你變得絕望,就在你即將放棄的那一剎那,你看到了這個答案,沒錯。就是你正在看著的這個答案:

(腦補柯南解釋案情的bgm)一切的一切在你修改/etc/nginx/conf.d/default.conf文件的那一刻,都已註定:你修改的語句末尾少了分號;

加上分號,:wq保存,運行systemctl restart nginx.service

整個世界又重歸美好

謹以此文,學中作樂,走過路過的朋友,不管有沒有幫到你,大家共勉

nginx提示Job for nginx.service failed because the control的問題