httpdは停止していますがサブシステムがロックされています。エラー

mysqlが起動しないかと思ったら、今度はhttpdが起動しない。

くぬお!!!!

エラー詳細

$ service httpd restart
httpd を停止中:                                             [失敗]
httpd を起動中: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
                                                           [失敗]

エラーログを確認する

$ less /etc/httpd/logs/error_log
[Wed Jul 27 21:29:30 2016] [warn] child process 15750 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 23001 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 20165 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21126 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 22001 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 20548 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 19986 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 20182 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 23086 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21237 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 20600 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21459 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 22609 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21474 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21477 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21521 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 22163 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 22136 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21552 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21554 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21555 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21610 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 15486 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21638 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21643 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21653 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 23637 still did not exit, sending a SIGTERM
[Wed Jul 27 21:29:30 2016] [warn] child process 21688 still did not exit, sending a SIGTERM

ふぁっ!?

と、とりあえず、文法チェックする。

$ service httpd configtest
Syntax OK

文法は問題なし。

初心にかえり、停止も失敗していたことを思い出し、状態を確認する。

$ service httpd status
httpdは停止していますがサブシステムがロックされています。

cliで急に流暢、かどうかはわからないが日本語が返ってくると少し興奮します。

httpdのサブシステムって何だろう?

とりあえずここはgoogle先生に尋ねてみると・・・

/var/lock/subsys/にあるhttpdを削除すると生き返ることがあるそうだ。

$ ls -la /var/lock/subsys/
drwxr-xr-x. 2 root root 4096  7月 27 21:39 2016 .
drwxrwxr-x. 5 root lock 4096  7月 27 03:57 2016 ..
-rw-r--r--  1 root root    0  7月 21 21:49 2016 NetworkManager
-rw-r--r--  1 root root    0  7月 21 21:49 2016 acpid
-rw-r--r--  1 root root    0  7月 21 22:10 2016 atd
-rw-r--r--  1 root root    0  7月 21 21:49 2016 blk-availability
-rw-r--r--  1 root root    0  7月 21 22:10 2016 crond
-rw-r--r--  1 root root    0  7月 21 21:49 2016 cups
-rw-r--r--  1 root root    0  7月 21 21:49 2016 dovecot
-rw-r--r--  1 root root    0  7月 27 21:39 2016 httpd
-rw-r--r--  1 root root    0  7月 21 21:49 2016 iptables
-rw-r--r--  1 root root    0  7月 21 22:10 2016 local
-rw-r--r--  1 root root    0  7月 25 13:02 2016 mysqld
-rw-r--r--  1 root root    0  7月 21 21:49 2016 network
-rw-r--r--  1 root root    0  7月 21 21:49 2016 ntpd
-rw-r--r--  1 root root    0  7月 21 21:49 2016 ntpdate
-rw-r--r--  1 root root    0  7月 21 21:49 2016 postfix
-rw-------  1 root root    0  7月 21 21:49 2016 rsyslog
-rw-r--r--  1 root root    0  7月 21 21:49 2016 sshd

だが、httpdは、いなかった。

これをヒントに、あ、プロセス残ってるんじゃないかと思いつき、プロセスを確認してみる。

$ ps aux | grep httpd
root     17684  0.0  0.0 107464   920 pts/0    S+   21:39   0:00 grep httpd
apache   19986  0.0  0.5 499192 11228 ?        S    Jul26   0:14 /usr/sbin/httpd
apache   21728  0.0  0.8 497832 15992 ?        S    Jul26   0:33 /usr/sbin/httpd

いた。

全部殺す。

$ kill -9 19986
$ kill -9 21728
$ service httpd status
httpd は停止しています
$ service httpd start
httpd を起動中:                   [  OK  ]

解決しました。

スポンサーリンク

シェアする

  • このエントリーをはてなブックマークに追加

フォローする

スポンサーリンク