Bug 30675

Summary: `noatime' should be discouraged on /var as well
Product: Documentation Reporter: gene <gene>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description gene 2001-09-19 22:50:00 UTC
tuning(7) manpage says that `noatime' mount option should not be used for / and /usr filesystems as some system utilities rely on correct access timestamps.  This should be extended to /var as well, because /var typically contains mailboxes, whose access and modification timestamps are used to determine arrival of new mail.
Comment 1 chern freebsd_committer freebsd_triage 2001-09-20 01:52:32 UTC
A quick grep -Ri "atime" /usr/src/contrib/sendmail/ shows that sendmail
does not use file atime's for any operations.  Mail program often use
*modification timestamps* (mtime), which is not changed by the noatime
option.

Generally speaking, mtime is updated every time a file's contents is
changed, atime is changed whenever a file is accessed.

If my memory serves me correctly, postfix does not make use of atime
either--I safely run a postfix server with noatime enabled on /var.

- chern
Comment 2 gene 2001-09-20 03:55:41 UTC
Chern,

Your observation is correct.  Sendmail does not explicitly manipulate
the mtime nor the atime.

What happens is, when sendmail has something to deliver to a mailbox, it
just opens the mailbox file as write-only.  This operation updates only
the mtime of the mailbox, and its atime is preserved.  Result: the
mailbox now has an mtime more recent than its atime, which is the
indication of new mail.

See also tcsh(1), under the description of `mail' variable.

Regards,
Eugene

A mail-reader resets that condition by reading from the mailbox.  
On Wed, Sep 19, 2001 at 05:52:32PM -0700, Chern Lee wrote:
> A quick grep -Ri "atime" /usr/src/contrib/sendmail/ shows that sendmail
> does not use file atime's for any operations.  Mail program often use
> *modification timestamps* (mtime), which is not changed by the noatime
> option.
> 
> Generally speaking, mtime is updated every time a file's contents is
> changed, atime is changed whenever a file is accessed.
> 
> If my memory serves me correctly, postfix does not make use of atime
> either--I safely run a postfix server with noatime enabled on /var.
> 
> - chern
> 
>
Comment 3 murray 2001-09-24 02:50:24 UTC
.. So, can someone provide an example sentence or two that they would
like to add to tuning(7)?  A diff would be even better.

     - Murray
Comment 4 Murray Stokely freebsd_committer freebsd_triage 2001-09-24 02:50:32 UTC
State Changed
From-To: open->feedback

Awaiting updated text from the originator.
Comment 5 Murray Stokely freebsd_committer freebsd_triage 2001-09-24 08:36:41 UTC
State Changed
From-To: feedback->closed

Thanks, Giorgos' patch was applied with minor modifications.