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.

-- 
Stéphane

Reply via email to