Supervisor / supervisor

Supervisor process control system for Unix (supervisord)
http://supervisord.org
Other
8.34k stars 1.23k forks source link

Missing output in log files #1549

Closed casperklein closed 1 year ago

casperklein commented 1 year ago

I have this supervisor configuration for fetchmail:

[program:fetchmail]
startsecs=0
autostart=false
autorestart=true
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
user=fetchmail
command=/usr/bin/fetchmail -f /etc/fetchmailrc --nodetach --daemon 300 -i /var/lib/fetchmail/.fetchmail-UIDL-cache --pidfile /var/run/fetchmail/fetchmail.pid

When I start fetchmail with supervisorctl start fetchmail and then check /var/log/supervisor/fetchmail.log, I see a log entry like:

fetchmail: starting fetchmail 6.4.16 daemon

However, if I run fetchmail manually with

su -s /bin/bash fetchmail -c 'fetchmail -f /etc/fetchmailrc --nodetach --daemon 300 -i /var/lib/fetchmail/.fetchmail-UIDL-cache --pidfile /var/run/fetchmail/fetchmail.pid',

I see more output:

fetchmail: starting fetchmail 6.4.16 daemon
fetchmail: sleeping at Sun Oct 23 18:33:01 2022 for 300 seconds
fetchmail: awakened at Sun Oct 23 18:38:01 2022
fetchmail: sleeping at Sun Oct 23 18:38:01 2022 for 300 seconds

Does anyone have an idea, why the "sleeping/awakened" lines are missing, when running via supervisord?

Edit: In both cases, I see lines like this, when emails arrive:

1 message for foo@example.com at pop.example.net (13341 octets).

So only the sleeping/awakened lines seem problematic.

casperklein commented 1 year ago

I don't think it's a supervisor issue. fetchmail seems to recognize if it's run with a tty attached or not.

Running manually with | cat appended, I get the same output as supervisor:

su -s /bin/bash fetchmail -c 'fetchmail -f /etc/fetchmailrc --nodetach --daemon 300 -i /var/lib/fetchmail/.fetchmail-UIDL-cache --pidfile /var/run/fetchmail/fetchmail.pid | cat'