Skip to content

Commit

Permalink
Using copytruncate to avoid Passenger crash on log rotate.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspard committed Jul 15, 2013
1 parent 0611c22 commit f33b495
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 33 deletions.
17 changes: 10 additions & 7 deletions lib/zena/deploy/logrotate_app.rhtml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# zena apache2 app logrotate configuration for <%= config[:db_name] %>
# automatically generated file

<%= config[:app_root] %>/log/production.log {
weekly
missingok
rotate 9
compress
delaycompress
notifempty
copytruncate
weekly
missingok
rotate 9
compress
delaycompress
notifempty
copytruncate
}
47 changes: 21 additions & 26 deletions lib/zena/deploy/logrotate_host.rhtml
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
# zena apache2 logrotate configuration for <%= config[:host] %>
# automatically generated file

<%= config[:sites_root] %>/<%= config[:host] %>/log/apache2.access.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 www-data www-data
sharedscripts
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 www-data www-data
copytruncate
sharedscripts
prerotate
/usr/lib/cgi-bin/awstats.pl -update -config=<%= config[:host] %>
endscript
postrotate
if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
/etc/init.d/apache2 reload > /dev/null
fi
endscript
}

<%= config[:sites_root] %>/<%= config[:host] %>/log/apache2.error.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 www-data www-data
sharedscripts
postrotate
if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
/etc/init.d/apache2 reload > /dev/null
fi
endscript
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 www-data www-data
copytruncate
sharedscripts
}

0 comments on commit f33b495

Please sign in to comment.