Skip to content

Commit

Permalink
Merge pull request #107 from mayflower/fix/upstart-reload
Browse files Browse the repository at this point in the history
Fix reloading php-fpm on trusty & utopic
  • Loading branch information
Reno Reckling committed Jul 24, 2015
2 parents c48d8e4 + 4566cdd commit 64a91bd
Showing 1 changed file with 29 additions and 4 deletions.
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

0 comments on commit 64a91bd

Please # to comment.