$cfg = <<<EOT
[global]
+error_log = /dev/null
[poold_ondemand]
listen=127.0.0.1:9000
pm = ondemand
echo "Error 2\n";
}
proc_terminate($fpm);
- if (!feof($tail)) {
- echo stream_get_contents($tail);
- }
+ fpm_display_log($tail, -1);
fclose($tail);
proc_close($fpm);
}
[%s] NOTICE: fpm is running, pid %d
[%s] NOTICE: ready to handle connections
[%s] WARNING: [pool pool2] child %d said into stderr: "ERROR: Wrong IP address 'xxx' in listen.allowed_clients"
-[%s] WARNING: [pool pool2] child %d said into stderr: "ERROR: There are no allowed addresses for this pool"
+[%s] WARNING: [pool pool2] child %d said into stderr: "ERROR: There are no allowed %s"
[%s] WARNING: [pool pool2] child %d said into stderr: "ERROR: Connection disallowed: IP address '127.0.0.1' has been dropped."
[%s] NOTICE: Terminating ...
[%s] NOTICE: exiting, bye-bye!
$cfg = <<<EOT
[global]
+error_log = /dev/null
[poold_ondemand]
listen=127.0.0.1:9000
pm = ondemand
}
}
proc_terminate($fpm);
- if (!feof($tail)) {
- echo stream_get_contents($tail);
- }
+ fpm_display_log($tail, -1);
fclose($tail);
proc_close($fpm);
}
echo "Request error\n";
}
proc_terminate($fpm);
- echo stream_get_contents($tail);
+ fpm_display_log($tail, -1);
fclose($tail);
proc_close($fpm);
}
$srcfile = __DIR__.'/php-fpm.tmp.php';
@unlink($logfile);
@unlink($srcfile);
-?>
\ No newline at end of file
+?>
printf("File %s %s\n", $pidfile, (file_exists(__DIR__.'/'.$pidfile) ? "exists" : "missing"));
proc_terminate($fpm);
- echo stream_get_contents($tail);
+ fpm_display_log($tail, -1);
fclose($tail);
proc_close($fpm);
printf("File %s %s\n", $pidfile, (file_exists(__DIR__.'/'.$pidfile) ? "still exists" : "removed"));
printf("File %s %s\n", $slwfile, (file_exists(__DIR__.'/'.$slwfile) ? "exists" : "missing"));
proc_terminate($fpm);
- echo stream_get_contents($tail);
+ fpm_display_log($tail, -1);
fclose($tail);
proc_close($fpm);
readfile(__DIR__.'/'.$accfile);
if (!(file_exists('/usr/bin/getfacl') && file_exists('/etc/passwd') && file_exists('/etc/group'))) die ("skip missing getfacl command");
$cfg = <<<EOT
[global]
+error_log = /dev/null
[unconfined]
listen = 127.0.0.1:9999
listen.acl_users = nobody
listen.acl_groups = nobody
listen.mode = 0600
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 2
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
EOT;
if (test_fpm_conf($cfg, $msg) == false) { die("skip " . $msg); }
?>
passthru("/usr/bin/getfacl -cp $socket");
proc_terminate($fpm);
- echo stream_get_contents($tail);
+ fpm_display_log($tail, -1);
fclose($tail);
proc_close($fpm);
}
echo "Request error\n";
}
proc_terminate($fpm);
- echo stream_get_contents($tail);
+ fpm_display_log($tail, -1);
fclose($tail);
proc_close($fpm);
}
/* }}} */
function fpm_display_log($tail, $n=1, $ignore='systemd') { /* {{{ */
- while ($n) {
+ /* Read $n lines or until EOF */
+ while ($n>0 || ($n<0 && !feof($tail))) {
$a = fgets($tail);
if (empty($ignore) || !strpos($a, $ignore)) {
echo $a;