Bad file descriptor

David Jenkins david.jenkins at
Tue Jan 11 00:47:44 PST 2005

Hi all,

I have no idea what's causing the problem here but it seems that mail cannot
be delivered to the root account - I know I should have mail forwarded to a
different user in the aliases file...

I'm running 5.3-RELEASE-p2 (haven't applied the latest patch yet) and
GENERIC kernel. The MTA is sendmail, the box is only used for web
services for a few friends.

Anyway, last night, when the daily periodic was run by cron it appears the
mail could not be delivered to root.

The sendmail logs show the error

DSN: Service unavailable (/var/mail/root: lstat: file changed after open)

I have tried emailing other user accounts, and that works fine. I have tried
emailing root again, and I get exactly the same errors.

So, I checked /var/mail - here's the interesting thing.

# ls
<some user accounts> root <some more user accounts>

# ls -a
. .. <some user accounts> root <some more user accounts>

# ls -la
<some user accounts>
<some more user accounts>

i.e. root's file does not show.

# touch root
touch: root: Bad file descriptor

I tried

# vi /var/mail/root
(which created a new file, I saved it (empty), and the box paniced and

I've checked google / the mailing list archives but can't seem to find
anything relevant (I must be searching for the wrong keywords). If
someone could give me a few pointers that would be great.


More information about the freebsd-questions mailing list