2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Nginxが再起動できなかった場合の対処法

Last updated at Posted at 2021-09-01

##Nginxのリスタートでエラー

Nginxを再起動した際にNginxがエラーを出力させた、なぜだ??

$ sudo systemctl restart nginx
# エラーの発生
# job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

##とりあえずエラーメッセージを実行する

$ systemctl status nginx.service
$ journalctl -xe

うーん、、、
なんとなくプロセスが残ってるのかなと思った

##解決方法
とりあえずNginxのプロセスを確認してみよう。

$ sudo lsof -i | grep nginx
nginx     15930     ~      
nginx     15930     ~       
nginx     15930     ~        
nginx     15941     ~    
nginx     15941     ~    
nginx     15941     ~    
nginx     15942     ~    
nginx     15942     ~   
nginx     15942     ~ 

残ってた笑
それじゃkillコマンドで強制的に終了させよう(-9で強制)

$ sudo kill -9 15930
$ sudo kill -9 15941
$ sudo kill -9 15942

Nginxの
プロセスを再度確認

$ sudo lsof -i | grep nginx

###消えた、これで実行だ!!!!!!!!

$ sudo systemctl restart nginx

動いた!!!!!!

##結論
焦らずプロセスの確認をしましょう笑

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?