futimes Error in Maillog

Vernon Schryver vjs@calcite.rhyolite.com
Wed Feb 1 15:26:27 UTC 2006

> From: Andrew Wood 

> cp rcDCC /etc/rc.d/init.d/DCC

a minor nit is that `ln -s /var/dcc/libexec/rcDCC /etc/rc.d/init.d/DCC`
lets rcDCC get updated

> but when I do a lint test the DCC check times out and I am seeing the
> following line in my maillog
> dccifd[10167]: futimes(/var/dcc/log/tmp.1Y9HKt): Function not implemented

Last week Wolfgang Breyha diagnosed that.  Giving user (evidently
postfix in your system) that runs the daemon a valid shell works around
the problem.

What is going on is:

 If dccid, dccm, or dccd is run as a non-root user, and if that
     that user does not have a valid shell, then on some but not all
     UNIX-like systems,  `su - $DCCUID -c dccifd ...` in the start-up script
     fails.  The script fall back on running `dccifd -I $DCCUID ...`

 One of the first thing `dccifd -I` does is permanently release priviliges.

 It's nice to have dccifd log files for mail messages have the same
     mtimes as the timestamp in the start of the file so the system log
     entries from the MTA (e.g. postfix or sendmail), the contents of
     the log file, and file itself all agree even if the SMTP transaction
     took a long time.  For example, the proof-of-concept CGI scripts as
     well as the log directory cleaning cron script ought to treat log
     files in the same order as their internal timestamps.

  utime() or utimes() can be used to fix the mtime of the log file at
     the end of the transaction, but it forces the kernel to slog throug
     namei() to convert a path to an inode to adjust.  
     futimes() seems faster where it is available.

  At least some versions of Linux have a kludge implementation of
     futimes() is based on what seems to be buggy file descriptor file
     implementation.  It ssems that futimes uses /proc/self/fd/X, which
     has ownership and permissions
        lrwx------  1 root root 64 Jan 25 22:23 /proc/22857/fd/X
     It cannot be used by the process after the process has has released
     privileges.  This is true even when the file is opened long after
     privileges have been released.

     See for example

The DCC futimes()/mtime() code is also used to work around the Linux
bug where the mtime of /var/dcc/map never changes despite changes made
to the file via mmap().

I guess I'll have to add #ifnedef LINUX to the use of futimes()

Vernon Schryver    vjs@rhyolite.com

More information about the DCC mailing list

Contact vjs@rhyolite.com by mail or use the form.