Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 587444 - dev-lang/php: use upstream's systemd service
Summary: dev-lang/php: use upstream's systemd service
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-28 20:20 UTC by Craig Andrews
Modified: 2017-04-07 00:53 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Andrews gentoo-dev 2016-06-28 20:20:19 UTC
PHP includes a systemd service definition, so Gentoo should use that instead of creating and maintaining its down.

So I believe that these 2 files should be deleted:
https://github.com/gentoo/gentoo/blob/4826d99cdd0ec59d041dd7ce888238a3825bc0b1/dev-lang/php/files/php-fpm_at-simple.service
https://github.com/gentoo/gentoo/blob/4826d99cdd0ec59d041dd7ce888238a3825bc0b1/dev-lang/php/files/php-fpm_at.service

and the ebuild should install the systemd service that the PHP build system produces instead.

It looks like Gentoo will have to patch upstream's systemd unit's ExecStart= line, because upstream doesn't support slotting (I imagine that a sed invocation could handle that).
Comment 1 Mike Gilbert gentoo-dev 2016-06-29 15:48:35 UTC
Can you provide a link to the units provided by upstream?

If we have to patch them anyway, there may be little point in using them.
Comment 2 Craig Andrews gentoo-dev 2016-06-29 15:52:02 UTC
Here's upstream's:
https://github.com/php/php-src/blob/master/sapi/fpm/php-fpm.service.in

Just because they're similar now, doesn't mean they always will be - upstream may fix things or add features, in which case it will be nice to get those things. In my opinion, Gentoo should always try to use what upstream provides in all cases, and when not possible, submit patches upstream so that it eventually can.
Comment 3 Mike Gilbert gentoo-dev 2016-06-29 17:02:59 UTC
It looks like we may be using a gentoo-specific wrapper script to implement the slotting support here. If that's the case, upstream's service file is not useful.
Comment 4 Craig Andrews gentoo-dev 2016-06-29 18:35:15 UTC
(In reply to Mike Gilbert from comment #3)
> It looks like we may be using a gentoo-specific wrapper script to implement
> the slotting support here. If that's the case, upstream's service file is
> not useful.

The only difference is the ExecStart= line - could Gentoo just replace that line with its own? Then at least the rest of the file will be upstream.
Comment 5 Michael Orlitzky gentoo-dev 2016-12-09 16:31:12 UTC
(In reply to candrews from comment #4)
> 
> The only difference is the ExecStart= line - could Gentoo just replace that
> line with its own? Then at least the rest of the file will be upstream.

The PIDFile line is also different, because @localstatedir@ is set to ${EPREFIX}/var.

A patch for the service file would be bigger than the service file itself, but I'm not strongly opposed to patching. I don't use systemd, however, so I can't do this myself. Someone else would have to write the patch, update the ebuilds, and test them.
Comment 6 Michael Orlitzky gentoo-dev 2017-03-14 16:08:23 UTC
I generally agree with the premise of this bug, that we should offload whatever work we can to upstream. But in this case, I think it's more trouble than it's worth: the service files are tiny and we need to change 2/5 of the [service] definition.

If no one writes/tests a patch, I'll eventually assume that you all agree with me and mark this WONTFIX =)