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

Side by Side Diff: modules/nginx/manifests/init.pp

Issue 29420624: Noissue - Fix nginx's restart command (Closed)
Patch Set: Created April 24, 2017, 6:53 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 class nginx ( 1 class nginx (
2 $worker_processes = $nginx::params::worker_processes, 2 $worker_processes = $nginx::params::worker_processes,
3 $worker_connections = $nginx::params::worker_connections, 3 $worker_connections = $nginx::params::worker_connections,
4 $ssl_session_cache = $nginx::params::ssl_session_cache, 4 $ssl_session_cache = $nginx::params::ssl_session_cache,
5 $geoip_country = undef, 5 $geoip_country = undef,
6 $geoip_city = undef, 6 $geoip_city = undef,
7 ) inherits nginx::params { 7 ) inherits nginx::params {
8 8
9 # Class['ssh'] is assumed to handle SSL-related quirks and therefore 9 # Class['ssh'] is assumed to handle SSL-related quirks and therefore
10 # the inclusion here became necessary. 10 # the inclusion here became necessary.
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 215
216 exec {"set_logfiles_permissions": 216 exec {"set_logfiles_permissions":
217 command => shellquote($find_chmod_base, $find_chmod_exec), 217 command => shellquote($find_chmod_base, $find_chmod_exec),
218 unless => shellquote($find_chmod_base, $find_kill_exec), 218 unless => shellquote($find_chmod_base, $find_kill_exec),
219 subscribe => Service['nginx'], 219 subscribe => Service['nginx'],
220 } 220 }
221 221
222 $restart_command = join([ 222 $restart_command = join([
223 'set -e', 223 'set -e',
224 'pid=`cat /var/run/nginx.pid`', 224 'pid=`cat /var/run/nginx.pid`',
225 'kill -USR2 "$pid"', 225 'kill -HUP "$pid"',
226 'sleep 2',
227 'kill -QUIT "$pid"',
228 ], "\n") 226 ], "\n")
229 227
230 service {'nginx': 228 service {'nginx':
231 ensure => running, 229 ensure => running,
232 enable => true, 230 enable => true,
233 restart => $restart_command, 231 restart => $restart_command,
234 hasstatus => true, 232 hasstatus => true,
235 require => Package['nginx'], 233 require => Package['nginx'],
236 } 234 }
237 235
238 Service['nginx'] <~ Class['ssh'] 236 Service['nginx'] <~ Class['ssh']
239 237
240 file {'/usr/share/nginx/html/50x.html': 238 file {'/usr/share/nginx/html/50x.html':
241 mode => 0644, 239 mode => 0644,
242 owner => 'root', 240 owner => 'root',
243 require => Package['nginx'], 241 require => Package['nginx'],
244 source => 'puppet:///modules/nginx/50x.html', 242 source => 'puppet:///modules/nginx/50x.html',
245 } 243 }
246 } 244 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld