日期:2014-05-16 浏览次数:21084 次
[root@localhost shell]# cat /www/a.html
OK
[root@localhost ~]# lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 32105 root 3u IPv4 409340 TCP *:http (LISTEN)
httpd 32109 daemon 3u IPv4 409340 TCP *:http (LISTEN)
httpd 32111 daemon 3u IPv4 409340 TCP *:http (LISTEN)
httpd 32113 daemon 3u IPv4 409340 TCP *:http (LISTEN)
[root@localhost ~]# killall httpd
[root@localhost ~]# lsof -i:80
[root@localhost ~]# lsof -i:80 在我杀死httpd进程的大概一两秒时间内,apache服务没有起来,但是很快就可以了,
如果是在实际生产中,可以把脚本中的sleep时间改成1.
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 618 root 3u IPv4 411612 TCP *:http (LISTEN)
[root@localhost ~]# lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 618 root 3u IPv4 411612 TCP *:http (LISTEN)
httpd 623 daemon 3u IPv4 411612 TCP *:http (LISTEN)
httpd 625 daemon 3u IPv4 411612 TCP *:http (LISTEN)
httpd 627 daemon 3u IPv4 411612 TCP *:http (LISTEN)
a.html.106 a.html.………………
我擦,发现爆表了,忘记了,脚本还没有完善,需要把这东西全干掉
而且我还想要记录apache的重启时间和次数,所以还需要更改脚本
#!/bin/bash
while [ 1 ]
do
wget http://