The init script installed by php-5.4.0_rc1 for FPM (/etc/init.d/php-fpm) contains reference to 5.3 slot configuration. So if php:5.3 is installed, php:5.4 uses the 5.3 configuration in /etc/php/fpm-php5.3/ instead of the 5.4 configuration in /etc/php/fpm-php5.4/ And after cleaning the 5.3 slot and removing the corresponding configuration, php-fpm:5.4 logically does not start anymore... I think that this parameter should be changed by eselect too. If I understand correctly, currently eselect changes the link /usr/bin/php-fpm. Why not change the configuration directory too and provide a symlink /etc/php/php-fpm -> /etc/php/php-fpm-${SLOT} and then use this link without version number in the init script ?
Thanks for reporting this. I'll whip up some magic soon.
Created attachment 292475 [details] Init script with multi-slot support
Try the attached init script. It should respect eselect settings, as well as allow you to start multiple versions of php-fpm if you symlink the initscript to something like /etc/init.d/php-fpm-5.4
You should put the PHPSLOT detect code in a function, like 'get_phpslot' and call it from start() and stop(). Otherwise the eselect php show fpm will be executed evrytime openrc cache is rebuild, as it does 'source' every init script and it will result in slowing system boot down.
Works great thanks. Just one more thing : While you are upgrading the init script, it could be cool to fix the openrc warnings too (nothing to do with this bug but, this could be fixed at the same time ;)) --- php-fpm 2011-11-14 09:38:39.763518132 +0100 +++ /etc/init.d/php-fpm 2011-11-14 09:43:10.809446311 +0100 @@ -10,7 +10,8 @@ PHP_FPM_PID="/var/run/php-fpm-${PHPSLOT}.pid" -opts="depend start stop reload" +extra_commands="depend" +extra_started_commande="reload" depend() { need net
(In reply to comment #5) Sorry, there is a typo error : should read extra_started_commands and not extra_started_commande --- php-fpm 2011-11-14 09:38:39.763518132 +0100 +++ /etc/init.d/php-fpm 2011-11-14 09:43:10.809446311 +0100 @@ -10,7 +10,8 @@ PHP_FPM_PID="/var/run/php-fpm-${PHPSLOT}.pid" -opts="depend start stop reload" +extra_commands="depend" +extra_started_commands="reload" depend() { need net
(In reply to comment #4) > You should put the PHPSLOT detect code in a function, like 'get_phpslot' and > call it from start() and stop(). Otherwise the eselect php show fpm will be > executed evrytime openrc cache is rebuild, as it does 'source' every init > script and it will result in slowing system boot down. Probably a very minimal slowdown, but this is easy to implement, so no problem. (In reply to comment #5) > -opts="depend start stop reload" > +extra_commands="depend" > +extra_started_commande="reload" > > depend() { > need net How will this work with baselayout-1? Maybe all three variables should be defined?
More and more init scripts are converted without any condition (look at your init.d dir, even sshd is migrated, no conditionnal at all). And baselayout-1 is no-more in tree (it was remove 2 months ago). opts is deprecated and openrc mainteners wants to remove opts support : http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=df1f02ac
In fact, there is a tracker : https://bugs.gentoo.org/show_bug.cgi?id=381895 If you want, I can open a new bug for that to attach to the tracker to keep track of this change if you want not to polute the phpslot problematic here (sorry for that).
Created attachment 292531 [details] New attempt at a new init script Nah, tracking it in this bug is fine. How about this version? I think it should address both problems mentioned.
You use bashy string manipulators, and runscript execute /bin/sh, so this will fail hard if your /bin/sh is not symlinked to bash. You should stay with the ${SVCNAME#php-fpm-} or something like it, the #, ##, % and %% is supported by posix sh, sed-alike /string/ is not.
It's working fine for me, but I'm not expert with bashisms Thanks !
Created attachment 292609 [details] Version bar bashisms Ok. I tested this one using dash, so I hope this will make everyone happy :)
Just a notice : you have merge the changes to $FILESDIR/php-fpm.init, but the ebuild of php-5.4.0_rc* uses $FILESDIR/php-fpm-r4.init (PHP_FPM_INIT_VER="4") Thanks !
Bump. Init script could use the bump in ~arch.
Sorry it took some time to fix this. Actually, we cannot really support multiple versions of the init script because the different slots would overwrite each other. Try now and see if it works.
Looks good to me now. Thanks !