php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #52898 init: Get php_fpm_PID from conf file (patch)
Submitted: 2010-09-21 06:01 UTC Modified: 2010-09-21 08:15 UTC
From: php-bugs at thequod dot de Assigned: fat (profile)
Status: Not a bug Package: FPM related
PHP Version: 5.3.3 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php-bugs at thequod dot de
New email:
PHP Version: OS:

 

 [2010-09-21 06:01 UTC] php-bugs at thequod dot de
Description:
------------
The following patch is meant to get the php_fpm_PID file from php_fpm_CONF and 
output a warning if it is not configured.

The patch will probably not apply cleanly to SVN (it is based on the Ubuntu 
package, where e.g. @sbindir@ is used - not checked though).
Because it is trivial, I am leaving it as-is (but can refresh it against SVN, if 
you want me to).

Please consider it applying to the next release.

Index: php5-5.3.3/sapi/fpm/init.d.php-fpm.in
===================================================================
--- php5-5.3.3.orig/sapi/fpm/init.d.php-fpm.in  2010-07-27 18:22:48.000000000 
+0200
+++ php5-5.3.3/sapi/fpm/init.d.php-fpm.in 2010-07-27 18:25:56.000000000 +0200
@@ -15,8 +15,11 @@

 php_fpm_BIN=@sbindir@/php-fpm
-php_fpm_CONF=@sysconfdir@/php-fpm.conf
-php_fpm_PID=@localstatedir@/run/php-fpm.pid
+php_fpm_CONF=@sysconfdir@/php5/fpm/php5-fpm.conf                                                                                                                  
+php_fpm_PID=$(grep '^pid' $php_fpm_CONF | tail -n1 | cut -f2 -d= | tr -d ' ')

+if [ -z $php_fpm_PID ] ; then
+ echo "warning, no pid file configured in $php_fpm_CONF."
+fi

 php_opts="--fpm-config $php_fpm_CONF"



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-21 08:15 UTC] fat@php.net
-Status: Open +Status: Bogus -Assigned To: +Assigned To: fat
 [2010-09-21 08:15 UTC] fat@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

init.d.php-fpm.in is a sample for package managers who will tune it to match their 
need. No changes will be made here.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 12:01:30 2024 UTC