From 4222a113dc34ddc5c2a5040279684ce6e7721ba3 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Fri, 11 Sep 2015 12:47:10 +0200 Subject: [PATCH] Create upstart service override before installing php-fpm --- manifests/fpm.pp | 10 ++++++++++ manifests/fpm/service.pp | 17 +++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/manifests/fpm.pp b/manifests/fpm.pp index b784eb80..fd02d2a7 100644 --- a/manifests/fpm.pp +++ b/manifests/fpm.pp @@ -49,4 +49,14 @@ $real_pools = hiera_hash('php::fpm::pools', $pools) create_resources(::php::fpm::pool, $real_pools) + + # Create an override to use a reload signal as trusty and utopic's + # upstart version supports this:q + if $::osfamily == 'Debian' and + ($::lsbdistcodename == 'trusty' or $::lsbdistcodename == 'utopic') { + file { "/etc/init/${::php::fpm::service::service_name}.override": + content => 'reload signal USR2', + before => Package[$real_package], + } + } } diff --git a/manifests/fpm/service.pp b/manifests/fpm/service.pp index 0d4a2ad2..c327ffa6 100644 --- a/manifests/fpm/service.pp +++ b/manifests/fpm/service.pp @@ -26,20 +26,9 @@ 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], - } + $restart = $::lsbdistcodename ? { + 'precise' => undef, + default => $reload } } else { $restart = $reload