Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix reloading php-fpm on trusty & utopic #107

Merged
merged 1 commit into from
Jul 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions manifests/fpm/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,36 @@
warning('php::fpm::service is private')
}

$reload = "service ${service_name} reload"

if $::osfamily == 'Debian' {
# Precise upstart doesn't support reload signals, so use
# regular service restart instead
if $::lsbdistcodename == 'precise' {
$restart = undef
} else {
$restart = $reload
}

# Create an override to use a reload signal as trusty and utopic's
# upstart version supports this
if ($::lsbdistcodename == 'trusty' or
$::lsbdistcodename == 'utopic') {
file { "/etc/init/${service_name}.override":
content => 'reload signal USR2',
before => Service[$service_name],
}
}
} else {
$restart = $reload
}

service { $service_name:
ensure => $ensure,
enable => $enable,
restart => "service ${service_name} reload",
hasstatus => true,
ensure => $ensure,
enable => $enable,
hasrestart => true,
restart => $restart,
hasstatus => true,
}

::Php::Extension <| |> ~> Service[$service_name]
Expand Down