Note that there are some explanatory texts on larger screens.

plurals
  1. POMonit on CentOS causes httpd.pid not to be created
    primarykey
    data
    text
    <p>The solution was to replace this line:</p> <pre><code>check process apache with pidfile /var/run/httpd.pid </code></pre> <p>With this line:</p> <pre><code>check process httpd with pidfile /var/run/httpd/httpd.pid </code></pre> <p>And I also removed the 'group apache'.</p> <p>Original post:</p> <p>After installing <a href="http://mmonit.com/monit/" rel="nofollow">Monit</a> on CentOS, and setting an alert for the Apache (httpd) service, the service no longer creates the /var/run/httpd.pid file.</p> <p>The httpd service <strong>IS</strong> running properly.</p> <p>On top of it, as if that's not enough, Monit reports the status of the service as: Execution failed</p> <p>Naturally, the only way to restart such a service is by killing it, since the 'restart' script doesn't see any running process.</p> <p>These are the contents of the /etc/monit.d/monitrc file:</p> <pre><code>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 than 180% for 1 cycles then alert if totalmem &gt; 1200 MB for 2 cycles then restart if children &gt; 250 then restart check process sshd with pidfile /var/run/sshd.pid start program "/etc/init.d/sshd start" stop program "/etc/init.d/sshd stop" if failed port 22 protocol ssh for 5 cycles then restart if 5 restarts within 25 cycles then timeout </code></pre> <p>Output of "service httpd restart":</p> <pre><code>Stopping httpd: [FAILED] Starting httpd: (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 [FAILED] </code></pre> <p>Any help will be greatly appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload