← Back to team overview

ius-coredev team mailing list archive

[Bug 1098319] Re: php-fpm should be reloaded on upgrade

 

Brandon,

It's actually pretty common for RHEL to include a condrestart or reload
in the RPMs for services since you need to restart the service so it
will use the new binary.

I checked a few random RPMs using `rpm -q --scripts some_rpm` and found
the following include a condrestart:

* openssh-server
* rsyslog
* cronie
* ntp
* mysql-server
* mysql51-server from IUS
* mysql55-server from IUS


For the people who don't know they're supposed to manually reload php-fpm, they're potentially running a very old version of PHP on their websites which probably isn't what they intended when they started using the IUS repo.

A few notes about the change:

* I did a reload instead of a condrestart. reload sends a SIGUSR2 signal
which does a 'graceful reload of all workers + reload of fpm
conf/binary'. I did this instead of a condrestart since the condrestart
does full stop followed by a start. A reload will not start the php-fpm
service if it was previously turned off.

* When upgrading RPMs, the postun section is run by the old RPM being
removed. So if this was released as php53u-5.3.20-2 , the reload won't
happen until php53u-5.3.20-2 is upgraded by php53u-5.3.20-3 or
php53u-5.3.21-1 . This is documented at
http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Scriptlet_Ordering
. All the RPMs and documentation I checked for Fedora and RHEL have the
condrestart in the postun section, I couldn't find a reason why it is
done this way but decided to keep it consistent.

-- 
You received this bug notification because you are a member of IUS Core
Development, which is subscribed to IUS Community Project.
https://bugs.launchpad.net/bugs/1098319

Title:
  php-fpm should be reloaded on upgrade

Status in IUS Community Project:
  New

Bug description:
  If you're using php-fpm, you need to reload php-fpm when php is
  updated, otherwise all the members of the php-fpm pool will continue
  to run on the older version of PHP. This can be a quite old version
  depending on when the last time you did a php-fpm reload.

  You can check this by upgrading a server and checking the phpinfo of a
  site, it will still show the old version. If you do a 'lsofp -p $PID |
  grep deleted' on the php-fpm process, you'll see it is running off the
  older deleted php-fpm binary. When you do a reload of php-fpm, it will
  fix it.

  Fedora now does a reload of php-fpm on upgrade:
  http://pkgs.fedoraproject.org/cgit/php.git/plain/php.spec

To manage notifications about this bug go to:
https://bugs.launchpad.net/ius/+bug/1098319/+subscriptions


References