- Package:
- supervisor
- Source:
- supervisor
- Submitter:
- Dominic Hopf
- Date:
- 2023-10-08 13:45:04 UTC
- Severity:
- important
Dear Maintainer, Running dpkg -S supervisor I see that the supervisor package also provides the directory /var/log/supervisor, but does not provide a logrotate configuration file in /etc/logrotate.d/ for files placed in there. When you have a lot of services managed by supervisor which produce a lot of output this leads to disk space issues quite fast on productive servers, thus my rating for this issue as important.
Hello, Supervisor documentation shows that the rotation of supervisor.log file is done automatically by supervisord (see http://supervisord.org/logging.html#activity-log-rotation). ## quote ## The activity log is “rotated” by supervisord based on the combination of the logfile_maxbytes and the logfile_backups parameters in the [supervisord] section of the configuration file. When the activity log reaches logfile_maxbytes bytes, the current log file is moved to a backup file and a new activity log file is created. ## end of quote ## According to http://supervisord.org/configuration.html page, the configuration of `logfile_maxbytes` and `logfile_backups` have been introduced in 3.0. As you used 3.3, it should work. Your report shows the '/etc/supervisor/supervisord.conf changed'. Did you modify these values? Can you still provide the configuration file used?
The e-mail address from the submitter does not work anymore: 550 5.1.1 Recipient address rejected: undeliverable address So we will never get a reply to my questions.
I tried with supervisor package (4.2.5-1) and I failed to get a
rotation automatically. The configuration file is not modified so the
default values should be used by supervisord.
Steps:
1. fill /var/log/supervisor/supervisord.log file under 50M:
$ ls -l /var/log/supervisor/supervisord.log
-rw-rw-rw- 1 root root 49994043 24 sept. 10:04
/var/log/supervisor/supervisord.log
$ ls -lh /var/log/supervisor/supervisord.log
-rw-rw-rw- 1 root root 48M 24 sept. 10:04 /var/log/supervisor/supervisord.log
2. Restart supervisord:
$ sudo systemctl stop supervisor.service
$ sudo systemctl start supervisor.service
3. Force supervisor to write on supervisord.log with a crashing daemon:
$ for i in $(seq 1 3000); do {sudo supervisorctl start demo; sleep 10}; done
'demo' crashes everytime. The loop restarts 'demo' because otherwise
'supervisord' set 'demo' process as BACKOFF status after several
attempts. Then, supervisord does not try to restart it again (which is
probably a good strategy).
4. See results:
$ ls -la /var/log/supervisor/supervisord.log
-rw-rw-rw- 1 root root 51476910 25 sept. 09:07
/var/log/supervisor/supervisord.log
$ ls -lh /var/log/supervisor/supervisord.log
-rw-rw-rw- 1 root root 50M 25 sept. 09:07 /var/log/supervisor/supervisord.log
The file is over 50M but there is no rotation:
$ sudo find /var/log -name "supervisord.log*"
/var/log/supervisor/supervisord.log
'/var/log/supervisor/supervisord.log.1' does not exist.
I plan to read source code and probably raise an issue on supervisor
github repository if needed.
After running the loop much more time, the log file has been rotated: $ ls -lh /var/log/supervisor/ total 53M -rw-r--r-- 1 root root 3,0M 8 oct. 14:33 supervisord.log -rw-rw-rw- 1 root root 51M 26 sept. 16:55 supervisord.log.1 $ ls -l /var/log/supervisor/ total 54184 -rw-r--r-- 1 root root 3041778 8 oct. 14:33 supervisord.log -rw-rw-rw- 1 root root 52428822 26 sept. 16:55 supervisord.log.1 It seems the rotation occurs when the size goes from 50 to 51M. The file rotation works so I think this bug report can be closed with a 'unreproducible' tag.