Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 944135 - dev-lang/php restarting php-fpm doesn't work after updating php and eselecting new php
Summary: dev-lang/php restarting php-fpm doesn't work after updating php and eselectin...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-20 12:17 UTC by Sandu Adrian
Modified: 2024-11-21 14:36 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ULS's variation of the php-fpm script (ulphp-fpm,2.55 KB, text/plain)
2024-11-21 12:15 UTC, Jaco Kroon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sandu Adrian 2024-11-20 12:17:07 UTC
Recently I've updated from php 8.1 to 8.2, removed 8.1
Ran eselect php set fpm 1 ( since 1 was the only one and it was 8.2 )
Then ran /etc/init.d/php-fpm restart
It yelled
/etc/init.d/php-fpm: line 61: /usr/lib64/php8.1/bin/php-fpm: No such file or directory [!!]

Further debug on IRC got to a /run/openrc/options/php-fpm/PHP_SLOT which still said 8.1

Doing /etc/init.d/php-fpm stop then /etc/init.d/php-fpm start worked.

eselect should recommend stopping and starting the fpm when changing.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-21 11:04:18 UTC
Just to add some more background: we had some fun debugging this on IRC.

This behaviour was introduced, I think, by the changes for bug 910589. service_get_value is used which means you get *different* behaviour between /etc/init.d/php-fpm restart and /etc/init.d/php-fpm stop and then /etc/init.d/php-fpm start.

navi and I spoke about it as well and we're not really sure if that's intentional or if such persistence should only apply to e.g. reload.
Comment 2 Jaco Kroon 2024-11-21 12:15:59 UTC
Created attachment 910988 [details]
ULS's variation of the php-fpm script

I can't comment for others, but this is the init script that works for us, as per the bug Sam referenced we had similar frustrations.  This was based off of the original gentoo init script.
Comment 3 Michael Orlitzky gentoo-dev 2024-11-21 14:36:58 UTC
Yeah, sorry. Managing the active slot with OpenRC is... not ideal. There's more discussion on bug 761319, but I opened bug 632690 now seven years ago to fix it.

The init script has to manage a daemon that can't change on-the-fly. Instead of having one script for all versions of PHP, we should have one script for each PHP. This is how most other slotted daemons work, and it would let us upstream the OpenRC scripts so that we don't have to ship them as part of eselect-php (which is already weird).