[clug] what's happened to atime?

Daniel Pittman daniel at rimspace.net
Mon Apr 19 03:56:38 MDT 2010


Michael James <michael at james.st> writes:

> Back when Linux made sense, cat-ing a file changed it's atime.

...it still does, if you tell it to.

> So when a daemon refused to obey some configuration change,
>  first you restart it and look at your file's atime with ls -lu
> Hasn't been updated? It's not reading your configuration file, use strace.

Er, personally I would start with looking at the logs from my change
management tool, or the output of my shell first, but obviously YMMV.

> Then came SSDs, benchmarks, and file system wars.
> And with them came the pox of acl, xattr, and noatime.
>
> So, why does my /etc/apache2/httpd.conf not show any sign of being read when
> apache2 starts?

Well, at a guess because your system is configured with either noatime, or
relatime, either of which will case most access to skip the atime update.

My guess is that ...

[...]

> fstab	LABEL=ROOT2     /               ext4    acl,user_xattr          1 1

... since you don't specify anything here, you get the upstream default, which
is to configure atime the way most people use it — off, or possibly relatime
so that rare tools that look at it don't break.

So, to fix this be explicit: add the 'atime' option to your fstab to force the
configuration.  Depending on how your distro boots you may also need to tell
the kernel to mount root with that option on the kernel command line.

Regards,
        Daniel

-- 
✣ Daniel Pittman            ✉ daniel at rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons


More information about the linux mailing list