Re: sanity check: why am I unable to manage my own directory with systemd-tmpfiles?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 31, 2025 at 09:32:58AM +0200, Mantas Mikul??nas wrote:
> Run it directly on your config file as:
> 
>     SYSTEMD_LOG_LEVEL=debug systemd-tmpfiles --remove --clean
> /path/to/tmpfiles.d/foobar.conf

Your debug suggestion was very helpful:

  Jan 31 10:20:47 10-153-68-12 systemd-tmpfiles[19650]: Reading config file "/usr/lib/tmpfiles.d/foobar.conf".
  Jan 31 10:20:47 10-153-68-12 systemd-journald[581]: Forwarding to syslog missed 1 messages.
  Jan 31 10:20:47 10-153-68-12 systemd-tmpfiles[19650]: Running remove action for entry q /home/foobar/tmp
  Jan 31 10:20:47 10-153-68-12 systemd-tmpfiles[19650]: Running clean action for entry q /home/foobar/tmp
  Jan 31 10:20:47 10-153-68-12 systemd-tmpfiles[19650]: Cleanup threshold for directory "/home/foobar/tmp" is Tue 2025-01-21 10:20:47.550246 EST
  Jan 31 10:20:47 10-153-68-12 systemd-tmpfiles[19650]: File "/home/foobar/tmp/example.2024-12-17": change time Thu 2025-01-30 18:02:55.725580 EST is too new.
  ...

Here, systemd-tmpfiles shows it's gating on ctime, not mtime.

Well, that's not accurate.  If I look at this on-line doc for tmpfiles.d:

  https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html

It does weigh in on this aging:

  The age of a file system entry is determined from its last
  modification timestamp (mtime), its last access timestamp (atime),
  and (except for directories) its last status change timestamp
  (ctime). By default, any of these three (or two) values will
  prevent cleanup if it is more recent than the current time minus
  the age field.

But the manpage for tmpfiles.d(5) on my distro (SLES12SP6):

  10-153-68-12:~ # rpm -qf /usr/share/man/man5/tmpfiles.d.5.gz
  systemd-228-157.63.1.x86_64

contains none of that verbiage whatsoever.

> If you want to only consider modification time, specify it as something
> like "mM:10d" ??? see "Age" in tmpfiles.d(5).

I cannot find any reference to this modifier, in either that online
doc I cited above, nor in the manpage for tmpfiles.d(5) for my
distro.

Can you provide a pointer to some doc explaining that directive?

> -- 
> Mantas Mikul??nas

-- 
Brian Reichert				<reichert@xxxxxxxxxxx>
BSD admin/developer at large	



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux