Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/nginx/manifests/init.pp

Issue 29344646: Issue 4073 - Improve Nginx integration with "upstart" service provider (Closed)
Patch Set: Issue 4073 - Address feedback from code-review Created May 27, 2016, 3:32 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/nginx/manifests/init.pp
diff --git a/modules/nginx/manifests/init.pp b/modules/nginx/manifests/init.pp
index a6b3d85540ac791163bc20c7578d92179b4648db..7e3b09a7dd05ce2ab047d6f96919c3b02f919096 100644
--- a/modules/nginx/manifests/init.pp
+++ b/modules/nginx/manifests/init.pp
@@ -47,7 +47,6 @@ class nginx (
file {'/etc/nginx/nginx.conf':
content => template('nginx/nginx.conf.erb'),
require => Package['nginx'],
- notify => Service['nginx']
}
file {'/etc/nginx/sites-available':
@@ -196,12 +195,21 @@ class nginx (
subscribe => Service['nginx'],
}
+ $restart_command = join([
+ 'set -e',
+ 'pid=`cat /var/run/nginx.pid`',
+ 'kill -USR2 "$pid"',
+ 'sleep 1',
+ 'kill -QUIT "$pid"',
+ ], "\n")
+
service {'nginx':
ensure => running,
enable => true,
- restart => '/etc/init.d/nginx reload',
hasstatus => true,
- require => File['/etc/nginx/nginx.conf']
+ require => Package['nginx'],
+ restart => $restart_command,
+ subscribe => File['/etc/nginx/nginx.conf'],
}
file {'/usr/share/nginx/html/50x.html':
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld