Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemd on-demand socket-based activation #81

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

gchaix
Copy link

@gchaix gchaix commented Sep 12, 2016

Provides support for creating systemd socket-based activation of on-demand PHP-FPM daemons.

Defines php::fpm::systemd-socket-conf that will create the corresponding systemd .socket and .service configurations. Multiple pools may be created using separate sockets/services so that rolling, zero-downtime restarts of PHP-FPM may be accomplished.

Tested on CentOS7 and Debian Jessie.

Based heavily on http://thanatos.be/2014/04/12/php-fpm-ondemand.html

* Creates php::fpm::systemd-socket-conf for systemd sockets
* Adds systemd socket and service
* Modified config file templates that allow for multiple php-fpm master
processes.
The socket starts the service as needed.  Enabling it in puppet can
cause a race condition where the service tries to start before the socket
exists.
The PID directory only needs to be created once and including it in the
systemd-socket-conf will attempt to define it multiple times if multiple
pools are defined.  Moving it to a daemon manifest so it only happens
once.
Move systemd service path into params.pp
Add binary to params.pp
Make service template use binary parameter
Puppet on Debian wants to call 'service' instead of 'systemctl'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant