Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 01 Nov 2024 08:40:53 -0400
From:      "Dan Langille" <dan@langille.org>
To:        "John Levine" <johnl@iecc.com>, "RW via freebsd-questions" <freebsd-questions@freebsd.org>
Cc:        dale@dalescott.net
Subject:   Re: dma: could not pick up queue file
Message-ID:  <c3f2a459-5d9a-4ddf-acaf-9677bc252c5e@app.fastmail.com>
In-Reply-To: <20241031225337.288E8A4F1F81@ary.qy>
References:  <685d00e3-bacb-45cd-a166-40c6a484347e@app.fastmail.com> <22042f18-4cbb-4f62-841b-fef4a7262899@app.fastmail.com> <1c49d4a22aefd22541a526d387912eb3@dalescott.net> <20241031225337.288E8A4F1F81@ary.qy>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Oct 31, 2024, at 6:53 PM, John Levine wrote:
> It appears that Dale Scott <dale@dalescott.net> said:
>>>> From time to time, this message appears in the logs. I don't know why.
>>>> 
>>>> Oct 18 03:01:00 x8dtu-pg01 dma[dma][92883]: could not pick up queue
>>>> file:
>>>> `/var/spool/dma/Q5993d.326f7fa48050'/`/var/spool/dma/M5993d.326f7fa48050':
>>>> No such file or directory
>>>> 
>>>> Why does this occur?
>
> I took a look at the code and I think it's a race condition deleting a queue
> file but I can't tell you where.
>
> I use dma on a bunch of client systems and they never queue anything.
> The queue file is created and deleted immediately as the mail goes out
> to the smarthost. I could imagine that if you periodically run dma -q,
> it could see a queue file which is then deleted by the time it tries
> to do something with it.

That prompted me to check this, because I do use crontabs, however, the
following seems to indicate that the cron is is not involved.

Case in point:

[12:32 x8dtu-pg01 dvl ~] % cat /usr/local/etc/cron.d/dma
*/30    *       *       *       *       root    /usr/libexec/dma -q

That crontab should be present on all my host which use dma.

I'll bet that changing that to 7/30 might avoid the race situation. Instead
of running at 0 and 30 minutes past the hour, it would run at 7 and 37 past.

This event occurred today.  These logs are slightly amended to obscure host names and email and IP addresses.  

Nov  1 00:00:10 wikis newsyslog[46335]: logfile turned over
Nov  1 03:05:42 wikis dma[46d60][90243]: new mail from user=root uid=26 envelope_from=<root@wikis.[redacted]>
Nov  1 03:05:42 wikis dma[dma][90258]: could not pick up queue file: `/var/spool/dma/Q46d60.432a50848050'/`/var/spool/dma/M46d60.432a50848050': No such file or directory
Nov  1 03:05:42 wikis dma[46d60][90243]: mail to=<dan@example.org> queued as 46d60.432a50848050
Nov  1 03:05:42 wikis dma[46d60.432a50848050][90243]: <dan@example.org> trying delivery
Nov  1 03:05:42 wikis dma[46d60.432a50848050][90269]: using smarthost (tallboy.[redacted]:25)
Nov  1 03:05:42 wikis dma[46d60.432a50848050][90269]: trying remote delivery to tallboy.[redacted] [10.0.0.1] pref 0
Nov  1 03:05:42 wikis dma[46d60.432a50848050][90269]: <dan@example.org> delivery successful
Nov  1 03:46:21 wikis dma[46d47][96425]: new mail from user=root uid=26 envelope_from=<root@wikis.[redacted]>

The above host also has the crontab


[12:36 wikis dvl ~] % cat /usr/local/etc/cron.d/dma
*/30    *       *       *       *       root    /usr/libexec/dma -q

Is this interpretation of the logs correct?

PID 90243 starts sending the mail
PID 90243 fails to pick up the file
PID 90243 queues the mail
PID 90243 delivers the mail

If that's correct, the crontab is not involved at all.

-- 
  Dan Langille
  dan@langille.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c3f2a459-5d9a-4ddf-acaf-9677bc252c5e>