• Debugging systemd-tmpfiles

    From Erwan David@21:1/5 to All on Thu Nov 28 17:20:01 2024
    I have setup systemd-tmpfiles in user mode as follows :

    systemd-tmpfiles --user --cat-config
    # /home/erwan/.config/user-tmpfiles.d/perso.conf
    d /home/erwan/tmp 0755 erwan erwan 60d
    d /home/erwan/Downloads 0755 erwan erwan 90d

    However, those directories are not cleaned.

    What should I check ?

    --
    Erwan David

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Erwan David on Thu Nov 28 18:00:01 2024
    On Thu, Nov 28, 2024 at 16:57:37 +0100, Erwan David wrote:
    I have setup systemd-tmpfiles in user mode as follows :

    systemd-tmpfiles --user --cat-config
    # /home/erwan/.config/user-tmpfiles.d/perso.conf
    d /home/erwan/tmp 0755 erwan erwan 60d
    d /home/erwan/Downloads 0755 erwan erwan 90d

    However, those directories are not cleaned.

    What should I check ?

    Well, this is not entirely clear to me:

    DESCRIPTION
    systemd-tmpfiles creates, deletes, and cleans up files and directories,
    using the configuration file format and location specified in
    tmpfiles.d(5). It must be invoked with one or more options --create,
    --remove, and --clean, to select the respective subset of operations.

    System services (systemd-tmpfiles-setup.service,
    systemd-tmpfiles-setup-dev.service, systemd-tmpfiles-clean.service)
    invoke systemd-tmpfiles to create system files and to perform system
    wide cleanup. [...]
    Users may use this to create and
    clean up files under their control, but the system instance performs
    global cleanup and is not influenced by user configuration. Note that
    this means a time-based cleanup configured in the system instance, such
    as the one typically configured for /tmp/, will thus also affect files
    created by the user instance if they are placed in /tmp/, even if the
    user instance's time-based cleanup is turned off.

    Do you have a --user service with "clean" in its name? Is it running?
    Does it have anything journalled?

    I wonder who thinks this is actually an improvement over dropping a
    find command in your crontab. One (admittedly complex) line and you're
    done versus trying to decipher all of *that*? I know which one I'd
    go with.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jman@21:1/5 to Erwan David on Thu Nov 28 20:50:01 2024
    Erwan David <erwan@rail.eu.org> writes:

    However, those directories are not cleaned.

    What should I check ?

    I've not yet used systemd-tmpfiles but the first thing that comes to my
    mind, if I had to use it, would to be very careful and mindful of the
    "purge" command, which can have surprising effects: https://www.phoronix.com/news/systemd-tmpfiles-purge-drama

    Cheers,

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)