-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remote_syslog 1.6.14 keeps deleted logfiles open #69
Comments
This happens when the files are symbolic links too, which means we can't stop logging by just removing a symbolic link but instead have to restart the service. |
Still happens in |
This seems to be an interaction with logrotate. $ sudo lsof | grep deleted
# many other remote_syslog files that are deleted
# ...
remote_sy 26216 26218 root 25r REG 202,1 391179605 176530 /var/log/nginx/core.access.log.1 (deleted) The default logrotate conf that ubuntu 14.04 ships /var/log/nginx/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi \
endscript
postrotate
[ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`
endscript
} and my log_files.yml looks like: files:
- # stuff
- /var/log/nginx/core.access.log
destination:
host: logs.papertrailapp.com
port: ##### |
I think @ChrisLundquist's problem is unrelated to @rolandkool's. @ChrisLundquist: check out copytruncate; that may prevent the leftover open file descriptors. |
@troy Thanks for the speedy reply! Yeah, my goal in the above was to give to simplest way to replicate an issue. You're right that the default nginx logrotate configuration doesn't use My rails app logs use $ sudo lsof | grep deleted
remote_sy 26216 root 23r REG 202,1 2295124 86059 /path/to/rails/app/e2e590b3d1b4942191c7fd20fbc74997d8b9d63c/build/log/production.log (deleted)
This could be related to the symlink issue, but I'm not entirely sure. |
@ChrisLundquist no problem for the quick reply. I'm going to transition your last email into a thread in our support system (so we can explore your environment more specifically), so please expect an email from |
We noticed that remote_syslog is keeping logfiles open that have been deleted.
An example lsof:
ruby 4894 root 10r REG 253,2 151396 65567 /path/to/catalina.out (deleted)
ruby 4894 root 11r DIR 0,10 0 649 inotify
ruby 4894 root 12r REG 253,2 151396 65567 /path/to/catalina.out (deleted)
ruby 4894 root 13r REG 253,2 13646 65556 /path/to/catalina.out (deleted)
ruby 4894 root 14r REG 253,7 29238 507906 /path/to/catalina.out
Is there a way, besides restarting the service, to prevent this or get rid of them?
The text was updated successfully, but these errors were encountered: