CentOS 7 restart FPM bugs

Hello,

the current stable ISPConfig version ( 3.0.5.4p9 ) contains a number of overrides in the restartPHP_FPM() function in /usr/local/ispconfig/server/mods-available/web_module.inc.php specifically for CentOS7.

However, in my case, those actually break the FPM functionality instead of fixing it for CentOS7.

My web environment:

  • php-fpm service ( from CentOS repo, version 5.4 )
  • php56-php-fpm service ( from Remi safe repo, version 5.6 )
  • php70-php-fpm service ( from Remi safe repo, version 7.0 )

I have added both PHP56 and PHP70 as "Additional PHP Versions", using the following init script :

  • php56: php56-php-fpm
  • PHP70: php70-php-fpm

When I add a site for a specific FPM version, ISPConfig correctly creates a config file in the appropriate directory, and tries to reload the specific FPM version.

However, this is overridden by an if in the restartPHP_FPM() function:

[...]
if($action == 'reload' && $init_script == $conf['init_scripts'].'/'.$web_config['php_fpm_init_script']) {
  [...]
  if(preg_match('/^ID=centos/m', $tmp) && preg_match('/^VERSION_ID="7"/m', $tmp)) {
    $initcommand = 'systemctl restart php-fpm.service';
  }
  [...]
}

There is a similar block right after it, which I omit for brevity. What this does, is that it basically hard-wires ISPConfig to only recognise php-fpm.service on CentOS7 for FPM.

As an example, let's assume that for a website I am switching from PHP56 to PHP70 (both FPM). Current behavior:

systemctl reload php-fpm.service
systemctl reload php-fpm.service

This results in... basically nothing. No appropriate service is being reloaded! Commenting out the $initcommand =... lines for CentOS7 cases yields the proper behavior:

systemctl reload php56-php-fpm.service
systemctl reload php70-php-fpm.service

Thank you in advance, Andriopoulos Nick.