Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

exim - bad file descriptor

139 views
Skip to first unread message

Steve

unread,
Jun 4, 2023, 1:40:08 AM6/4/23
to
Hi,

Running Debian bookworm fully updated.

Since a couple of weeks, i see strange lines in the logs:

2023-06-04T06:30:54.117016+02:00 box exim[24894]: 2023-06-04 06:30:54 1q5fOD-0006TT-2C failed to write to main log: length=91 result=-1 errno=9 (Bad file descriptor)
2023-06-04T06:30:54.150516+02:00 box exim[24894]: write failed on panic log: length=116 result=-1 errno=9 (Bad file descriptor)
jun 04 06:30:54 box.lan exim[24894]: 2023-06-04 06:30:54 1q5fOD-0006TT-2C failed to write to main log: length=91 result=-1 errno=9 (Bad file descriptor)
jun 04 06:30:54 box.lan exim[24894]: write failed on panic log: length=116 result=-1 errno=9 (Bad file descriptor)

Exim seems to work ok for internal mail.

Looked for information on the Net but didn't find anything that helped.

The setup must be Debian standard since I haven't tweaked any config
files (I don't know how to do that and I don't have any reason to do it,
I'm just using exim as internal mta).

It seems that /var/log/exim4/mainlog is filling up normally. I don't see
any panic log file in there though (what is a panic log). /var has
enough space left.

Why am I receiving the bad file desciptor log?

Thanks.

s.

Michel Verdier

unread,
Jun 4, 2023, 8:40:06 AM6/4/23
to
Le 4 juin 2023 Steve a écrit :

> 2023-06-04T06:30:54.117016+02:00 box exim[24894]: 2023-06-04 06:30:54 1q5fOD-0006TT-2C failed to write to main log: length=91 result=-1 errno=9 (Bad file descriptor)
> 2023-06-04T06:30:54.150516+02:00 box exim[24894]: write failed on panic log: length=116 result=-1 errno=9 (Bad file descriptor)
> jun 04 06:30:54 box.lan exim[24894]: 2023-06-04 06:30:54 1q5fOD-0006TT-2C failed to write to main log: length=91 result=-1 errno=9 (Bad file descriptor)
> jun 04 06:30:54 box.lan exim[24894]: write failed on panic log: length=116 result=-1 errno=9 (Bad file descriptor)

6h25 is the usual hour for cron.daily launching logrotate.
Check in /etc/logrotate.d/ if exim is reloaded/restarted after rotation.

Steve

unread,
Jun 4, 2023, 9:40:07 AM6/4/23
to
cat /etc/logrotate.d/exim4-base
/var/log/exim4/mainlog /var/log/exim4/rejectlog {
daily
missingok
rotate 10
compress
delaycompress
notifempty
nocreate
}


cat /etc/logrotate.d/exim4-paniclog
/var/log/exim4/paniclog {
size 10M
missingok
rotate 10
compress
delaycompress
notifempty
nocreate
}

Does this help?

Michel Verdier

unread,
Jun 4, 2023, 1:20:05 PM6/4/23
to
Le 4 juin 2023 Steve a écrit :

> Does this help?

Yes, nothing is done after rotation. But I don't remember the default
exim logging mechanism. Can you provide

grep -r log_file_path /etc/exim*

Steve

unread,
Jun 5, 2023, 2:20:06 AM6/5/23
to
This gives nothing.

Michel Verdier

unread,
Jun 5, 2023, 3:10:06 AM6/5/23
to
Le 5 juin 2023 Steve a écrit :

>>Yes, nothing is done after rotation. But I don't remember the default
>>exim logging mechanism. Can you provide
>>
>>grep -r log_file_path /etc/exim*
>
> This gives nothing.

Then can you provide
exim -bP
(snip ip adresses if you want)

Steve

unread,
Jun 5, 2023, 3:40:07 AM6/5/23
to
See attached file.

Merci pour ton aide Michel.
exim_bP.txt

Michel Verdier

unread,
Jun 5, 2023, 4:30:06 AM6/5/23
to
Le 5 juin 2023 Steve a écrit :

> Merci pour ton aide Michel.

De rien :) Let's continue in english for the list

> log_file_path = /var/log/exim4/%slog
> log_selector = +smtp_protocol_error +smtp_syntax_error +tls_certificate_verified +tls_peerdn

exim writes directly to the logfiles. If you get the error almost every
day it can be because of the rotation.

I don't know it exim provide a reload command, so try

systemctl reload exim4-base

it should be exim4-base but if the service is not found type exim and TAB
to find the actual service name

if it fails try

systemctl restart exim4-base

if one succeed without message and with code 0, add in
/etc/logrotate.d/exim4-base and /etc/logrotate.d/exim4-paniclog

postrotate
systemctl <reload|restart> exim4-base
endscript

if you add reload but still get the error try restart, I don't know if
the reload free the files

Steve

unread,
Jun 5, 2023, 4:40:06 AM6/5/23
to
Le 05-06-2023, à 10:21:52 +0200, Michel Verdier a écrit :

>Le 5 juin 2023 Steve a écrit :
>
>> Merci pour ton aide Michel.
>
>De rien :) Let's continue in english for the list

Sure.

>> log_file_path = /var/log/exim4/%slog
>> log_selector = +smtp_protocol_error +smtp_syntax_error +tls_certificate_verified +tls_peerdn
>
>exim writes directly to the logfiles. If you get the error almost every
>day it can be because of the rotation.

This error appears everyday. I boot my machine every morning at 6 am.

>I don't know it exim provide a reload command, so try
>
>systemctl reload exim4-base

systemctl reload exim4-base.service
Failed to reload exim4-base.service: Job type reload is not applicable for unit exim4-base.service.

systemctl status exim4-base.service
○ exim4-base.service - exim4-base housekeeping
Loaded: loaded (/lib/systemd/system/exim4-base.service; static)
Active: inactive (dead)
TriggeredBy: ● exim4-base.timer
Docs: man:exim4(8)




>it should be exim4-base but if the service is not found type exim and TAB
>to find the actual service name
>
>if it fails try
>
>systemctl restart exim4-base

I stopped and restarted the service. Now I get:

systemctl status exim4-base.service
○ exim4-base.service - exim4-base housekeeping
Loaded: loaded (/lib/systemd/system/exim4-base.service; static)
Active: inactive (dead) since Mon 2023-06-05 10:29:02 CEST; 35s ago
TriggeredBy: ● exim4-base.timer
Docs: man:exim4(8)
Process: 41181 ExecStart=/etc/cron.daily/exim4-base systemd-timer (code=exited, status=0/SUCCESS)
Main PID: 41181 (code=exited, status=0/SUCCESS)
CPU: 63ms

jun 05 10:29:02 box.lan systemd[1]: Starting exim4-base.service - exim4-base housekeeping...
jun 05 10:29:02 box.lan systemd[1]: exim4-base.service: Deactivated successfully.
jun 05 10:29:02 box.lan systemd[1]: Finished exim4-base.service - exim4-base housekeeping.


>if one succeed without message and with code 0, add in
>/etc/logrotate.d/exim4-base and /etc/logrotate.d/exim4-paniclog
>
> postrotate
> systemctl <reload|restart> exim4-base
> endscript
>
>if you add reload but still get the error try restart, I don't know if
>the reload free the files


Since this is a vanilla setup, I might as well uninstall and purge exim4
and re-install it (or postfix), what do you think?

Michel Verdier

unread,
Jun 5, 2023, 5:00:05 AM6/5/23
to
Yes I wonder why debian don't add the postrotate.
But there is a specific package exim4-config. So you can do
dpkg-reconfigure exim4-config
you should ask to use syslog and not direct logging
it will add log_file_path in config files (you can check after)

I only use postfix for me and clients for a long time, so don't ask me :
postfix rules :)

Steve

unread,
Jun 5, 2023, 5:20:05 AM6/5/23
to
Le 05-06-2023, à 10:50:00 +0200, Michel Verdier a écrit :

>Le 5 juin 2023 Steve a écrit :
>
>>>if one succeed without message and with code 0, add in
>>>/etc/logrotate.d/exim4-base and /etc/logrotate.d/exim4-paniclog
>>>
>>> postrotate
>>> systemctl <reload|restart> exim4-base
>>> endscript
>>>
>>>if you add reload but still get the error try restart, I don't know if
>>>the reload free the files
>>
>> Since this is a vanilla setup, I might as well uninstall and purge exim4
>> and re-install it (or postfix), what do you think?
>
>Yes I wonder why debian don't add the postrotate.
>But there is a specific package exim4-config. So you can do
>dpkg-reconfigure exim4-config

Just did that, left unchanged except for the minimize DNS request, which
I enabled.

>you should ask to use syslog and not direct logging

I did.

>it will add log_file_path in config files (you can check after)

Now:

log_file_path = /var/log/exim4/%slog

>I only use postfix for me and clients for a long time, so don't ask me :
>postfix rules :)

Maybe another story later… :)

steve

unread,
Jun 10, 2023, 4:20:06 AM6/10/23
to
Hi Michel and al,

After a few days with this configuration, same errors are still present.

I guess I'll have either to reinstall or go the postfix way.

Have a nice day,

steve

Michel Verdier

unread,
Jun 10, 2023, 5:20:07 AM6/10/23
to
On 2023-06-10, steve wrote:

> Hi Michel and al,
>
> After a few days with this configuration, same errors are still present.
>
> I guess I'll have either to reinstall or go the postfix way.

Just to be sure before you reinstall can you provide
exim -bP | grep syslog

steve

unread,
Jun 11, 2023, 9:00:07 AM6/11/23
to
Hi Michel,
syslog_duplication
syslog_facility =
syslog_pid
syslog_processname = exim
syslog_timestamp

Michel Verdier

unread,
Jun 12, 2023, 3:30:05 PM6/12/23
to
On 2023-06-11, steve wrote:

>>> After a few days with this configuration, same errors are still present.
>>>
>>> I guess I'll have either to reinstall or go the postfix way.
>>
>>Just to be sure before you reinstall can you provide
>>exim -bP | grep syslog
>
> syslog_duplication

Docs indicate it "controls duplicate log lines on syslog".
So adding syslog don't resolve the problem.

Sorry I don't have exim installed here and I can't help you more.
Try a purge+install. Perhaps after upgrading to bookworm :)

steve

unread,
Jun 13, 2023, 12:50:06 AM6/13/23
to
I've been a happy bookworm user for months already :)

Will give postfix a try one of these days.

Have a nice day
0 new messages