Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
I
ISPConfig 3
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 494
    • Issues 494
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 32
    • Merge Requests 32
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • ISPConfig
  • ISPConfig 3
  • Issues
  • #3777

Closed
Open
Opened Feb 25, 2016 by Till Brehm@tbrehmOwner

Improvements for php-fpm reload code

Thank you to Dominik for providing this code.

In der web_module.inc.php gaaaaanz unten vor dem return $retval folgenden Block rein:

// Now test if restart has hung up and do a restart instead of reload if (($init_script) && ($action == 'reload') && ($init_script != $conf['init_scripts'].'/'.$web_config['php_fpm_init_script'])) { $path_parts = pathinfo($init_script); $childcnt = exec('echo $(pgrep -c -P$(</opt/'.str_replace('-fpm', '', $path_parts['basename']).'/var/run/php-fpm.pid))');

// Count child-process number must be greater than 2
// 2 is the default process child-count (pm.start_servers = 2) -> see php-fpm.conf
// if it is only 2, then restart is also ok, because no webpages on it
if ($childcnt <= 2) {
    $initcommand = $app->system->getinitcommand($path_parts['basename'], 'restart', $path_parts['dirname']);

    $retval = array('output' => '', 'retval' => 0);
    exec($initcommand.' 2>&1', $retval['output'], $retval['retval']);
    $app->log("Restarting php-fpm after reload not worked: $initcommand", LOGLEVEL_DEBUG);
}

unset($childcnt);

}


Außerdem - beim den bisherigen Ausnahmen schlage ich vor die Zeile 261 (master-Stand) if($action == 'reload') { mit einem "else" anfangen zu lassen -> sonst läuft es bei ner reload-Action die schon in der ersten If-Abfrage drin war durch den zweiten Block auch noch durch... und das Init-Command im zweiten If sollte so aussehen: $initcommand = $app->system->getinitcommand($path_parts['basename'], 'restart', $path_parts['dirname']); weil das was aktuell drin steht startet einfach nur nochmal den System-FPM-Dienst statt dem Versionsspezifischen wofür es eigentlich da sein sollte....

Edited Oct 20, 2020 by Helmo
Assignee
Assign to
Planned features
Milestone
Planned features
Assign milestone
Time tracking
None
Due date
None
Reference: ispconfig/ispconfig3#3777