From d936e544cae2eb662d0b6a9ac9e82e7d4ecbbffd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 17 Jan 2013 16:37:44 +0200 Subject: [PATCH] use /var/run for fpm pid files currently /var/run/php is cleaned up by php session cleanup script which cleans up everything in that dir, not only php session files so as consequence this removes php-fpm pidfiles and service restart remains confused what to stop. php-wsdl cache files get nuked by the same problem, so those could be moved to /var/cache/php, so they could survive reboots probably it's wrong to have /var/run/php as php-session storage (note the generic namem it's not /var/run/php/sessions etc), but changing that would need more efforts, as need to support old and new configuration, and each php sapi could have different config (they have different php.ini (or equivalent) files) --- php-fpm-config.patch | 2 +- php-fpm.init | 4 ++-- php-fpm.logrotate | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/php-fpm-config.patch b/php-fpm-config.patch index ee7427b..03a9a7b 100644 --- a/php-fpm-config.patch +++ b/php-fpm-config.patch @@ -14,7 +14,7 @@ ; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@ ; Default Value: none -;pid = run/php-fpm.pid -+pid = /var/run/php/@processname@.pid ++pid = /var/run/@processname@.pid ; Error log file ; If it's set to "syslog", log is sent to syslogd instead of being written diff --git a/php-fpm.init b/php-fpm.init index b44f905..020fc78 100644 --- a/php-fpm.init +++ b/php-fpm.init @@ -8,7 +8,7 @@ # # processname: @processname@ # config: /etc/php/php-fpm.conf -# pidfile: /var/run/php/@processname@.pid +# pidfile: /var/run/@processname@.pid # # Source function library @@ -20,7 +20,7 @@ configfile=/etc/php/php-fpm.conf lockfile=/var/lock/subsys/@processname@ pidfile=$(sed -ne 's,^pid\s*=\s*\(.*\),\1,p' $configfile) -pidfile=${pidfile:-/var/run/php/@processname@.pid} +pidfile=${pidfile:-/var/run/@processname@.pid} start() { # Check if the service is already running? diff --git a/php-fpm.logrotate b/php-fpm.logrotate index 694b231..24172c6 100644 --- a/php-fpm.logrotate +++ b/php-fpm.logrotate @@ -1,4 +1,4 @@ -/var/log/@processname@.log +/var/log/php/@processname@.log { notifempty missingok -- 2.44.0