Discussion:
apache failed to start | false positive?
shadow
2015-07-23 10:06:59 UTC
Permalink
Hello monit community,

since I upgraded my servers to debian jessie I encountered the following
behavior.

Monit says it cannot start my apache2 anymore. Initialization failed.
Jul 23 11:59:00 www-xeon monit[495]: 'apache' process is not running
Jul 23 11:59:00 www-xeon monit[495]: 'apache' trying to restart
Jul 23 11:59:00 www-xeon monit[495]: 'apache' start: /etc/init.d/apache2
Jul 23 12:00:00 www-xeon monit[495]: 'apache' failed to start (exit status 0) -- /etc/init.d/apache2: Starting web server: apache2.
But it actually restarts the apache process is restarted. But claim that
it fails and unmonitors the service in the webgui. But if I stop the
apache again, monit kicks in and restarts it. So there seem to be two
false positives

At first I thought it could the wrong .pid entry in
/etc/monit/conf.d/apache. But that wasnt the case. (Changed in debian
jessie from /var/run/apache2 to /var/run/apache2/apache2.pid )
check process apache with pidfile "/var/run/apache2/apache2.pid"
start program = "/etc/init.d/apache2 start" with timeout 60 seconds
stop program = "/etc/init.d/apache2 stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
group server
Does anyone had similiar issues? Am I missing something?

thanks for this great tool - love it :)

cheers shadow // systemli.org
--
best regards | viele Gruesse, ***@systemli.org

receive my key: gpg --keyserver zimmermann.mayfirst.org --recv-keys
0x06264855BA2DE161F08905A85C6B6ED4248C1F32
Vincent WATREMEZ
2015-07-23 10:15:17 UTC
Permalink
Hi Shadow,

First, you need to aknowledge major changes introduced by jessie.
Apache changes from version 2.2 (wheezy) to version 2.4.
You have to change vhost directive for access control (Allow directive ...).
You will find all you need to know for managing this upgrade in the
official documentation, here:
http://httpd.apache.org/docs/2.4/en/upgrading.html

Hope this works for you!

Regardless, give us your feedback!
This would help prevent future questions from being asked. ;-)

Best regards,

Vincent
Post by shadow
Hello monit community,
since I upgraded my servers to debian jessie I encountered the following
behavior.
Monit says it cannot start my apache2 anymore. Initialization failed.
Jul 23 11:59:00 www-xeon monit[495]: 'apache' process is not running
Jul 23 11:59:00 www-xeon monit[495]: 'apache' trying to restart
Jul 23 11:59:00 www-xeon monit[495]: 'apache' start: /etc/init.d/apache2
Jul 23 12:00:00 www-xeon monit[495]: 'apache' failed to start (exit
status 0) -- /etc/init.d/apache2: Starting web server: apache2.
But it actually restarts the apache process is restarted. But claim that
it fails and unmonitors the service in the webgui. But if I stop the
apache again, monit kicks in and restarts it. So there seem to be two
false positives
At first I thought it could the wrong .pid entry in
/etc/monit/conf.d/apache. But that wasnt the case. (Changed in debian
jessie from /var/run/apache2 to /var/run/apache2/apache2.pid )
check process apache with pidfile "/var/run/apache2/apache2.pid"
start program = "/etc/init.d/apache2 start" with timeout 60 seconds
stop program = "/etc/init.d/apache2 stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
group server
Does anyone had similiar issues? Am I missing something?
thanks for this great tool - love it :)
cheers shadow // systemli.org
--
receive my key: gpg --keyserver zimmermann.mayfirst.org --recv-keys
0x06264855BA2DE161F08905A85C6B6ED4248C1F32
--
https://lists.nongnu.org/mailman/listinfo/monit-general
shadow
2015-07-23 10:25:50 UTC
Permalink
Hello Vincent,

I'm aware of that and adopted the config accordingly, when I did the
upgrade (2 weeks ago). Thats not a part of the problem.

cheers shadow // systemli.org
--
best regards | viele Gruesse, ***@systemli.org

receive my key: gpg --keyserver zimmermann.mayfirst.org --recv-keys
0x06264855BA2DE161F08905A85C6B6ED4248C1F32
Vincent WATREMEZ
2015-07-23 10:36:38 UTC
Permalink
Sorry for the confusion, Shadow.

It appears to me that the restart action *might* reach its timeout (but the
server starts anyway).

To be sure of how long it takes, maybe you could do something like:
time /etc/init.d/apache2 start
and adjust the timeout accordingly, if this is it.

Cheers,

Vincent
Post by shadow
Hello Vincent,
I'm aware of that and adopted the config accordingly, when I did the
upgrade (2 weeks ago). Thats not a part of the problem.
cheers shadow // systemli.org
--
receive my key: gpg --keyserver zimmermann.mayfirst.org --recv-keys
0x06264855BA2DE161F08905A85C6B6ED4248C1F32
shadow
2015-07-23 10:47:12 UTC
Permalink
Funny thing,

if I copy the file /var/run/apache2/apache2.pid --> /var/run/apache2.pid
(former location in configuration).

Monit is fine and recognized that the service is started and all is fine.

Even if I restart monit it does not recognize the new location. I
expected if I restart it, it should reread the new configuration file.

Is there an option to flush all internal configs and reread them?
Post by shadow
Hello monit community,
since I upgraded my servers to debian jessie I encountered the following
behavior.
Monit says it cannot start my apache2 anymore. Initialization failed.
Jul 23 11:59:00 www-xeon monit[495]: 'apache' process is not running
Jul 23 11:59:00 www-xeon monit[495]: 'apache' trying to restart
Jul 23 11:59:00 www-xeon monit[495]: 'apache' start: /etc/init.d/apache2
Jul 23 12:00:00 www-xeon monit[495]: 'apache' failed to start (exit status 0) -- /etc/init.d/apache2: Starting web server: apache2.
But it actually restarts the apache process is restarted. But claim that
it fails and unmonitors the service in the webgui. But if I stop the
apache again, monit kicks in and restarts it. So there seem to be two
false positives
At first I thought it could the wrong .pid entry in
/etc/monit/conf.d/apache. But that wasnt the case. (Changed in debian
jessie from /var/run/apache2 to /var/run/apache2/apache2.pid )
check process apache with pidfile "/var/run/apache2/apache2.pid"
start program = "/etc/init.d/apache2 start" with timeout 60 seconds
stop program = "/etc/init.d/apache2 stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
group server
Does anyone had similiar issues? Am I missing something?
thanks for this great tool - love it :)
cheers shadow // systemli.org
--
https://lists.nongnu.org/mailman/listinfo/monit-general
--
best regards | viele Gruesse, ***@systemli.org

receive my key: gpg --keyserver zimmermann.mayfirst.org --recv-keys
0x06264855BA2DE161F08905A85C6B6ED4248C1F32
shadow
2015-07-23 10:55:56 UTC
Permalink
Turns out that monit did not restarted properly or did not reread the
config properly.

After a monit reload - everything is fine.

Thanks for your help
Post by shadow
Funny thing,
if I copy the file /var/run/apache2/apache2.pid --> /var/run/apache2.pid
(former location in configuration).
Monit is fine and recognized that the service is started and all is fine.
Even if I restart monit it does not recognize the new location. I
expected if I restart it, it should reread the new configuration file.
Is there an option to flush all internal configs and reread them?
Post by shadow
Hello monit community,
since I upgraded my servers to debian jessie I encountered the following
behavior.
Monit says it cannot start my apache2 anymore. Initialization failed.
Jul 23 11:59:00 www-xeon monit[495]: 'apache' process is not running
Jul 23 11:59:00 www-xeon monit[495]: 'apache' trying to restart
Jul 23 11:59:00 www-xeon monit[495]: 'apache' start: /etc/init.d/apache2
Jul 23 12:00:00 www-xeon monit[495]: 'apache' failed to start (exit status 0) -- /etc/init.d/apache2: Starting web server: apache2.
But it actually restarts the apache process is restarted. But claim that
it fails and unmonitors the service in the webgui. But if I stop the
apache again, monit kicks in and restarts it. So there seem to be two
false positives
At first I thought it could the wrong .pid entry in
/etc/monit/conf.d/apache. But that wasnt the case. (Changed in debian
jessie from /var/run/apache2 to /var/run/apache2/apache2.pid )
check process apache with pidfile "/var/run/apache2/apache2.pid"
start program = "/etc/init.d/apache2 start" with timeout 60 seconds
stop program = "/etc/init.d/apache2 stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
group server
Does anyone had similiar issues? Am I missing something?
thanks for this great tool - love it :)
cheers shadow // systemli.org
--
https://lists.nongnu.org/mailman/listinfo/monit-general
--
https://lists.nongnu.org/mailman/listinfo/monit-general
--
best regards | viele Gruesse, ***@systemli.org

receive my key: gpg --keyserver zimmermann.mayfirst.org --recv-keys
0x06264855BA2DE161F08905A85C6B6ED4248C1F32
Vincent WATREMEZ
2015-07-23 11:09:50 UTC
Permalink
De nada! ('wasn't of much help, was I?!)
Post by shadow
Turns out that monit did not restarted properly or did not reread the
config properly.
After a monit reload - everything is fine.
Thanks for your help
Post by shadow
Funny thing,
if I copy the file /var/run/apache2/apache2.pid --> /var/run/apache2.pid
(former location in configuration).
Monit is fine and recognized that the service is started and all is fine.
Even if I restart monit it does not recognize the new location. I
expected if I restart it, it should reread the new configuration file.
Is there an option to flush all internal configs and reread them?
Post by shadow
Hello monit community,
since I upgraded my servers to debian jessie I encountered the following
behavior.
Monit says it cannot start my apache2 anymore. Initialization failed.
Jul 23 11:59:00 www-xeon monit[495]: 'apache' process is not running
Jul 23 11:59:00 www-xeon monit[495]: 'apache' trying to restart
/etc/init.d/apache2
Post by shadow
Post by shadow
Jul 23 12:00:00 www-xeon monit[495]: 'apache' failed to start (exit
status 0) -- /etc/init.d/apache2: Starting web server: apache2.
Post by shadow
Post by shadow
But it actually restarts the apache process is restarted. But claim that
it fails and unmonitors the service in the webgui. But if I stop the
apache again, monit kicks in and restarts it. So there seem to be two
false positives
At first I thought it could the wrong .pid entry in
/etc/monit/conf.d/apache. But that wasnt the case. (Changed in debian
jessie from /var/run/apache2 to /var/run/apache2/apache2.pid )
check process apache with pidfile "/var/run/apache2/apache2.pid"
start program = "/etc/init.d/apache2 start" with timeout 60 seconds
stop program = "/etc/init.d/apache2 stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
group server
Does anyone had similiar issues? Am I missing something?
thanks for this great tool - love it :)
cheers shadow // systemli.org
--
https://lists.nongnu.org/mailman/listinfo/monit-general
--
https://lists.nongnu.org/mailman/listinfo/monit-general
--
receive my key: gpg --keyserver zimmermann.mayfirst.org --recv-keys
0x06264855BA2DE161F08905A85C6B6ED4248C1F32
--
https://lists.nongnu.org/mailman/listinfo/monit-general
Loading...