Monit no puede reiniciar php5-fpm

Monit no puede reiniciar php5-fpm

Monit detecta correctamente que php5-fpm no está disponible como se ve en los registros. Sin embargo, no parece poder reiniciar el servicio.

registro:

[EDT Jun 11 18:04:20] error    : 'php5-fpm' failed, cannot open a connection to UNIX[/var/run/php5-fpm.sock]                                                   
[EDT Jun 11 18:04:20] info     : 'php5-fpm' trying to restart                                                                                                  
[EDT Jun 11 18:04:20] info     : 'php5-fpm' stop: /etc/init.d/php5-fpm                                                                                         
[EDT Jun 11 18:04:50] error    : 'php5-fpm' failed to stop  

y aquí está la configuración para monit

check process php5-fpm with pidfile /var/run/php5-fpm.pid                                                                                                      
  group php #change accordingly                                                                                                                                
  start program = "/etc/init.d/php5-fpm start"                                                                                                                 
  stop program = "/etc/init.d/php5-fpm stop"                                                                                                                   
  if failed unixsocket /var/run/php5-fpm.sock then restart   

reiniciar manualmente php5-fpm con "servicio de reinicio de php5-fpm" borra este error hasta que vuelva a suceder.

El servidor es ubuntu 14.04. PHP 5.6.9

Respuesta1

Inicié el contenedor acoplable con Ubuntu 14.04, monit y php5-fpm del PPA 'ondrey'.

Esto es lo que obtengo después de quitar el socket fpm:

[UTC Jun 12 17:03:06] error    : 'php5-fpm' failed, cannot open a connection to UNIX[/var/run/php5-fpm.sock]
[UTC Jun 12 17:03:06] info     : 'php5-fpm' trying to restart
[UTC Jun 12 17:03:06] info     : 'php5-fpm' stop: /etc/init.d/php5-fpm
[UTC Jun 12 17:03:06] info     : 'php5-fpm' start: /etc/init.d/php5-fpm
[UTC Jun 12 17:03:26] info     : 'php5-fpm' connection succeeded to UNIX[/var/run/php5-fpm.sock]

Parece que /etc/init.d/php5-fpm stop está fallando en su caso, y al observar el script, la única forma en que puede fallar es si los procesos se están ejecutando pero el script no logra detenerlos. El código de retorno es 2 entonces.

Dado que ubuntu ya tuvo problemas con upstart vs sysvinit, como en este caso: https://stackoverflow.com/questions/23464157/cant-start-or-stop-php-fpm-on-ubuntu

Le aconsejaría que cambie su configuración de monit para php5-fpm a:

check process php5-fpm with pidfile /var/run/php5-fpm.pid
    group php
    start program = "/usr/sbin/service php5-fpm start"
    stop program = "/usr/sbin/service php5-fpm stop"
    if failed unixsocket /var/run/php5-fpm.sock then restart

y ver si eso ayuda.

información relacionada