Deb: log rotation issue
See original GitHub issueI just noted that my Debian installed salt-minion still has its deleted log file open:
# sudo lsof|grep delete
...
salt-mini 32090 root 3w REG 8,1 5318 524377 /var/log/salt/minion.1 (deleted)
I wen’t to check the logrotation config file that comes with salt-common and notice that it does not signal to salt-minion that it has rotated it in any way.
Am I missing something here? If not, there are three possible solutions:
- add
copytruncate
to master and minion log rotation. This has the downside of log lines actually might go missing. Not good for security and/or debugging. - add pre- and postrotation scripts that shutdown master/minion. Works, but requires downtime. Definitely not good for long running minion tasks.
- Somehow signal to the minion and master that they should rotate their logs. This is the best option of them all. Also the trickiest since it requires patching Python code.
Oh - forgot to write - I have not modified the log rotation config files in any way on my local machine.
Issue Analytics
- State:
- Created 9 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
How to debug logrotate warnings or errors when logrotate is ...
Run the logrotate command manually in a debug mode and check for errors: ... Identify a configuration file causing the issue.
Read more >Troubleshooting issues with log rotation and archiving - AskF5
The logrotate script may not be configured to run daily. Processes may be logging at debug level. Logs may not be configured to...
Read more >logrotate won't rotate my logs automatically - Server Fault
Check that your logrotate is being run by cron. Edit: From the comment discussion - it appears that cron is not working correctly....
Read more >Sample logrotate configuration and troubleshooting -
The debug flag, -d , tells logrotate to go through the motions of rotating logs but not actually rotate them. It can be...
Read more >Solved: Hive log rotation issue on CDH 6 - Cloudera Community
In this CDH version, hive log4j changes from rotation by size (configured by cloudera manager) to rotation by size and day (RFA to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
What about adding a signal handler for
SIGUSR1
which closes and re-opens the file handler? Then, in the logrotate configuration:This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.