1
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 1 year has passed since last update.

Apacheサービスが再起動に失敗したため調べてみた

Last updated at Posted at 2022-06-22

はじめに

httpdのコンフィグファイルの設定変更後、httpdサービスの再起動を実施したら失敗したため、メモとして記事にまとめました。

事象を記載しました

httpdを再起動しました。

# systemctl restart httpd

httpd.serviceがfailedになっていました。

シスログ(/var/log/messages)を確認した所、何らかの原因により、httpdのプロセスの停止に時間がかかってタイムアウトした後、プロセスがKILLされているため、プロセス自体は停止されているように見えます。
5分後に再度、httpdサービスの再起動を実施したら、事象が解消しました。

# less /var/log/messages
  httpd.service stop-sigterm timed out. Killing.
 httpd.service: main process exited, code=killed, status=9/KILL
 Unit httpd.service entered failed state.

まとめ

基本的には、再度httpdのサービスの再起動した際に、上手くいったら問題ないと思いますが、
httpdサービス上でステートフルなアプリケーションが動作している場合は、ファイル書き込みなどの何かの処理が途中で中断されている可能性があるため、問題ないか確認が必要になると聞いたことがあります。

また、本事象とは別のケースですが、
httpdのコンフィグファイルの設定ミスや、
目視では気づかない余計なスペース等がコンフィグファイルに入っていて、httpdサービスの再起動に失敗することがあります。
コンフィグファイルを更新後、「httpd -t」コマンドで、文法の間違いがないか確認後、httpdサービスを再起動することをおすすめします。

※上記でいうコンフィグファイルとは、/etc/httpd配下のconfファイルのことです。

また、httpdサービスの再起動は、システムに影響を与える作業のため、実施する際は事前調整が必要な作業だと思いました。

1
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
1
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?