今天遇到个问题,很奇葩,搞了很久才搞定,记录如下:
[root@~]# time systemctl restart httpd
real 2m0.214s
user 0m0.007s
sys 0m0.006s
对,你没看错,是两分钟没错,怎么能等得了?那么问题来了,这TM是为什么?
然后就google各种搜啊,一晚上没睡好,夜里还在想这破问题。
https://unix.stackexchange.com/questions/432425/centos7-http-will-not-start-normally-httpd-works-systemctl-start-httpd-does-no ---错误帖子,和本问题无关
https://bugzilla.redhat.com/show_bug.cgi?id=907579 ---也是一个无关贴
别气馁,近了
https://serverfault.com/questions/462064/why-httpd-graceful-restart-takes-such-a-long-time---无关贴,but给了下面这个链接:
https://unix.stackexchange.com/questions/57439/slow-start-of-midnight-commander#answer-397879
最终是这个帖子给了灵感:
Try to delete line "search whatever.something" from /etc/resolv.conf
赶紧试一下子,删除resolv.conf中的所有内容,(前一天就发现了,dns不通,vpc内虚机不能访问外网。)很后悔,为什么之前不删除了那两条默认的dns:
[root@ ~]# cat /etc/resolv.conf
; generated by /usr/sbin/dhclient-script
# nameserver 8.8.4.4
# nameserver 114.114.114.114
如此,记录一下,默认httpd启动的时候要访问dns?造成了两分钟的timeout? 留到后面有时间看吧。
以上↑