SUSE Linux Enterprise 系统下的apache经常自动停止
查看apache目录下logs/error_log 文件,监控到apache自动停止时,会报如下错误
[Tue May 21 14:03:01 2013] [notice] seg fault or similar nasty error detected in the parent process
然后,再手动重启apache,该错误文件会有如下信息:
[Tue May 21 14:06:32 2013] [warn] pid file /home/mimetex/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [Tue May 21 14:06:32 2013] [notice] Apache/2.2.22 (Unix) configured -- resuming normal operations
一直没找到自动停止的原因,所以用crontab 每隔10秒钟,检测apache是否启动了,如果没启动,则执行启
动命令,crontab -e 增加如下定时任务:
* * * * * sleep 10;/mydir/autoapache.sh
autoapache.sh内容如下:
if [ `ps -ef|grep httpd | grep -v grep| wc -l` -eq 0 ];then ipcs -s | grep mimetex | perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}' su - mimetex -c "/home/mimetex/apache/bin/httpd -k start" fi 其中 ipcs -s | grep mimetex | perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}' 表示清空之前遗留的信号量。
相关推荐
Kafka 2020-09-18
Wepe0 2020-10-30
杜倩 2020-10-29
windle 2020-10-29
minerd 2020-10-28
mengzuchao 2020-10-22
Junzizhiai 2020-10-10
bxqybxqy 2020-09-30
风之沙城 2020-09-24
kingszelda 2020-09-22
大唐帝国前营 2020-08-18
yixu0 2020-08-17
TangCuYu 2020-08-15
xiaoboliu00 2020-08-15
songshijiazuaa 2020-08-15
xclxcl 2020-08-03
zmzmmf 2020-08-03
newfarhui 2020-08-03
likesyour 2020-08-01