lots of updates for debian

This commit is contained in:
John Bintz 2012-02-14 07:11:25 -05:00
parent d7015e9608
commit 60ffc07d7a
5 changed files with 45 additions and 3 deletions

View File

@ -0,0 +1,24 @@
class nginx-debian {
$log_root = "/var/log/nginx"
file { $log_root:
owner => root,
group => web,
mode => 2775
}
file { "$log_root/sites":
owner => root,
group => web,
mode => 2775,
require => File[$log_root]
}
$pid_file = pid_path('nginx')
logrotate_d { 'nginx':
postrotate => "sudo /bin/kill -USR1 `cat ${pid_file}`",
pattern => "/var/log/nginx/*/access.log /var/log/nginx/*/error.log",
require => Class['nginx']
}
}

View File

@ -33,7 +33,7 @@ class nginx($version) {
require => Exec['install-passenger'] require => Exec['install-passenger']
} }
file { [ '/var/log/nginx', $config_path ]: file { $config_path:
ensure => directory, ensure => directory,
before => God_init[$name] before => God_init[$name]
} }

View File

@ -43,11 +43,11 @@ God.watch do |w|
w.interval = 15.seconds w.interval = 15.seconds
w.start = lambda { system("<%= start %>") } w.start = lambda { system("<%= start %>") }
w.start_grace = 15.seconds w.start_grace = 10.seconds
<% if !stop.empty? %> <% if !stop.empty? %>
w.stop = lambda { system("<%= stop %>") } w.stop = lambda { system("<%= stop %>") }
w.stop_grace = 15.seconds w.stop_grace = 10.seconds
<% end %> <% end %>
<% if pid_file %> <% if pid_file %>

View File

@ -0,0 +1,6 @@
define logrotate_d($postrotate, $pattern) {
file { "/etc/logrotate.d/${name}":
content => template('logrotate_d/logrotate.d.erb')
}
}

View File

@ -0,0 +1,12 @@
<%= pattern %> {
daily
rotate 10000
missingok
compress
delaycompress
missingok
dateext
postrotate
<%= postrotate %>
endscript
}