小编biz*_*zna的帖子

CentOS上的Monit导致无法创建httpd.pid

解决方案是替换这一行:

check process apache with pidfile /var/run/httpd.pid
Run Code Online (Sandbox Code Playgroud)

有了这条线:

check process httpd with pidfile /var/run/httpd/httpd.pid
Run Code Online (Sandbox Code Playgroud)

我还删除了'组apache'.

原帖:

在CentOS上安装Monit并为Apache(httpd)服务设置警报后,该服务不再创建/var/run/httpd.pid文件.

httpd服务IS正常运行.

最重要的是,好像这还不够,Monit将服务状态报告为:执行失败

当然,重启这种服务的唯一方法就是杀死它,因为'restart'脚本看不到任何正在运行的进程.

这些是/etc/monit.d/monitrc文件的内容:

set daemon  10
set logfile syslog facility log_daemon
set mailserver localhost
set mail-format { from: me@server.com }
set alert bugs@server.com
set httpd port 2812 and
#     SSL ENABLE
#     PEMFILE  /var/certs/monit.pem
allow user:password

check process apache with pidfile /var/run/httpd.pid
group apache
start program = "/etc/init.d/httpd start"
stop program  = "/etc/init.d/httpd stop"
if cpu is greater …
Run Code Online (Sandbox Code Playgroud)

apache pid monit

3
推荐指数
1
解决办法
7349
查看次数

标签 统计

apache ×1

monit ×1

pid ×1