[rrd-developers] Ubuntu Lenny: rrd does not update the ctime and mtime of rrd-files

Tobias Oetiker tobi at oetiker.ch
Mon Sep 27 16:18:56 CEST 2010


Hi Kristoff,

Today Kristoff Bonne wrote:

> Hi All,
>
>
> I have a very strange problem.
>
> We are migrating our mrtg / rrd / weathtermap scripts from a server
> running debian Etch to debian Lenny.
>
> Now, we have a very strange fenomina:
> mrtg does update the rrd-files as normal, but does not update the ctime
> and mtime of the files.
>
>
> $ rrdtool dump test1.rrd | grep lastupdate
> 	<lastupdate>1285588262</lastupdate> <!-- 2010-09-27 13:51:02 CEST -->
>
> Last update is 27 sept. 13:51:02 (6 minutes ago)
>
>
> $ ls -l test1.rrd
> -rw-r--r-- 1 mrtg nogroup 105160 2010-09-22 17:27 test1.rrd
>
> Timestamp of file is 22 sept. 17:27 (when the file was created)
>
>
>
> $ stat test1.rrd
>    File: `test1.rrd'
>    Size: 105160    	Blocks: 208        IO Block: 4096   regular file
> Device: fe05h/65029d	Inode: 15882       Links: 1
> Access: (0644/-rw-r--r--)  Uid: ( 1010/    mrtg)   Gid: (65534/ nogroup)
> Access: 2010-09-27 13:55:28.079400385 +0200
> Modify: 2010-09-22 17:27:18.499395801 +0200
> Change: 2010-09-22 17:27:18.499395801 +0200
>
> access-time is adapted, but not ctime and mtime.
>
>
>
> I don't know if this is a problem related to rrd or debian; but I'm
> quite puzzled here!
> However, doing some tests with other applications (like vi) DO change
> the ctime and mtime of the file.
>
> I don't know if this is important, but the box is running on a
> xfs-filesystem.
>
>
> I have the problem with the original version of rrd running on the box
> (1.3.1-4) and the version available in the "backports" distribtution:
> 1.4.3-1~bpo50+1
>
>
> Anybody any idea?
> Is this a known issue?

the reason for this behaviour is that rrtool uses memory mapped io
for updating files ... some older linux kernels neglect to update
the timesamps of the files thus edited ..

rrdtool tool checks for this problem at compilation time and
compensates by doing touch on the problem files ...

when using a binary distribution of rrdtool you may find that it
has been compiled on a kernel where this problem does not show and
thus it does not have that 'fix' activated ...

the simplest solution is to compile rrdtool on the target machine,
it will then detect the problem and work around it ...

cheers
tobi


>
> The problem (for us) is that this destroyes our "cleanup" scripts as
> they all use the ctime/mtime to delete mrtg-files not used for more then
> a month. :-(
>
>
>
> Cheerio! Kr. Bonne.
>
> _______________________________________________
> rrd-developers mailing list
> rrd-developers at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900



More information about the rrd-developers mailing list