-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
php reloading on each run #613
Comments
After a little bit more research, the problem seems to be the following: Config.pp sets the user to the user, under which, php-fpm is running, which is apache by default. ensure_resource('file', ['/var/run/php-fpm/', '/var/log/php-fpm/'], {
ensure => directory,
owner => $user,
group => $group,
}) when restarting php-fpm, it gets reset to |
For those having this problem, it is possible to fix the issue by overriding the systemd service of php-fpm so that it does not manage the # /var/run/php-fpm creation
# Add a configuration for tmpfiles.d so that /var/run/php-fpm is created @boot
file { '/usr/lib/tmpfiles.d/php-fpm.conf':
ensure => present,
content => 'd /var/run/php-fpm 0755 apache apache'
}
# Override service:
# - Manage umask for php-fpm : allow file created by php to be modified by group
# - Remove the management of /var/run/php-fpm by systemd as the puppet-php module
# changes its ownership on each puppet run, triggering a restart of php-fpm
# every time puppet runs...
$umask_content = @(EOF)
[Service]
UMask=0002
RuntimeDirectory=
RuntimeDirectoryMode=
| EOF
file { '/etc/systemd/system/php-fpm.service.d/':
ensure => directory,
}
file { '/etc/systemd/system/php-fpm.service.d/override.conf':
content => $umask_content,
notify => [
Service['php-fpm'],
Exec['php-fpm-daemon-reload'],
]
}
exec { 'php-fpm-daemon-reload':
command => 'systemctl daemon-reload',
path => ['/bin','/usr/bin','/sbin'],
refreshonly => true,
notify => Service['php-fpm'],
} |
Perfect, this seems to have fixed my issue. |
AFAICT the discussed workaround is not required, the following commit fixed this issue by changing the owner to root: |
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
HIERA:
manifest:
What are you seeing
Hello,
on each puppet run, Puppet gets reloaded because the owner of
/var/run/php-fpm
gets changed fromroot
(the default one) toapache
.What behaviour did you expect instead
php should not be reloaded on each run
Output log
Any additional information you'd like to impart
The text was updated successfully, but these errors were encountered: