Re: noatime on ufs2

From: Warner Losh <imp_at_bsdimp.com>
Date: Tue, 09 Jan 2024 21:08:03 UTC
On Tue, Jan 9, 2024, 11:11 AM Steffen Nurpmeso <steffen@sdaoden.eu> wrote:

> robert@rrbrussell.com wrote in
>  <5f370bce-bcdb-47ea-aaa7-551ee092a7d3@app.fastmail.com>:
>  |On Tue, Jan 9, 2024, at 05:13, void wrote:
>  |> On Tue, Jan 09, 2024 at 09:47:59AM +0100, Olivier Certner wrote:i
>  |>> So, to me, at this point, it still sounds more than a gimmick
>  |>> than something really useful.  If someone has a precise use case
>
> Email existence checks are in UNIX for many decades.
> In fact since 1974-11-26 when Ken Thompson added that to login(1).
> "You have new mail" is in BSD since
>
>   Commit:     Bill Joy <wnj@ucbvax.Berkeley.EDU>
>   CommitDate: 1978-11-05 19:59:54 -0800
>

It has also been used for almost as long to see if log files have changed
if you set your MAIL variable to that. So not just for email...

Warner

    Start development on BSD 3
>     Create reference copy of all prior development files
>
> in BSD Mail and csh(1).
> And today in bash(1), for example, there can be read
>
>         /* If the user has just run a program which manipulates the
>            mail file, then don't bother explaining that the mail
>            file has been manipulated.  Since some systems don't change
>            the access time to be equal to the modification time when
>            the mail in the file is manipulated, check the size also.  If
>            the file has not grown, continue. */
>         if ((atime >= mtime) && !file_is_bigger)
>           continue;
>
>         /* If the mod time is later than the access time and the file
>            has grown, note the fact that this is *new* mail. */
>         if (use_user_notification == 0 && (atime < mtime) &&
> file_is_bigger)
>           message = _("You have new mail in $_");
>
> I would not exactly call this a gimmick.
> On Linux mount(8) from https://github.com/karelzak/util-linux says
>
>    relatime
>        Update inode access times relative to modify or change time. Access
>        time is only updated if the previous access time was earlier than
>        or equal to the current modify or change time. (Similar to noatime,
>        but it doesn’t break mutt(1) or other applications that need to
>        know if a file has been read since the last time it was modified.)
>
> and this is what i use, except for some noatime mount points
> (/x/doc, /x/music, /x/pub, to be exact).
>
> --steffen
> |
> |Der Kragenbaer,                The moon bear,
> |der holt sich munter           he cheerfully and one by one
> |einen nach dem anderen runter  wa.ks himself off
> |(By Robert Gernhardt)
>
>