Skip to content

Instantly share code, notes, and snippets.

@maxidr
Created September 18, 2013 13:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxidr/6609248 to your computer and use it in GitHub Desktop.
Save maxidr/6609248 to your computer and use it in GitHub Desktop.
Log rotate for thin server. You need to locate this files in folder: /etc/logrotate.d/ You can check using: logrotate -d thin
/opt/mxhero-apps/footers-web/shared/log/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 0640 ubuntu ubuntu
sharedscripts
postrotate
if [ -d /etc/logrotate.d/thin-postrotate ]; then \
run-parts /etc/logrotate.d/thin-postrotate; \
fi; \
endscript
}
PIDS=`find /opt/mxhero-apps/footers-web/shared/pids/ -type f | (while read line; do cat $line; echo -n " "; done;)`
[ ! -f /opt/mxhero-apps/footers-web/shared/pids/thin.3000.pid ] || kill -USR1 $PIDS
@kolobock
Copy link

kolobock commented Feb 6, 2015

-d flag checks for the directory existance but thin-postrotate is a file so line 11 should check for a file instead (with -f flag)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment