On 05/12/2013 11:28 AM, Andrey Borzenkov wrote:
В Sun, 12 May 2013 11:01:00 +0200 Andrea Turrini <andrea.turrini@gmail.com> пишет:
On 05/12/2013 10:37 AM, ErwinL wrote:
What you want to do doesn't work because the "Age" parameter is ignored with the "R" option. See "man tmpfiles.d" for details.
Oops, I have not noted this case. I really would like to know the rational behind this choice, since I find it very weird.
Do you have use case for it? "Very weird" is very weak argument.
This topic is the use case: how can I remove specific directories inside /tmp after 3 days while keeping the 10 days /tmp general cleaning? BTW, if I change date to test the effect of copying and adapting tmp.conf, I note the following: Via bios, I have advanced the hardware clock of 1 month, so I performed the test on Jun 12. After the boot, /tmp still contained files created on May. For instance: -rw------- 1 ori users 8350 May 12 12:01 clementine-art-Qq1103.jpg -rw------- 1 ori users 8350 May 10 23:15 clementine-art-Rd1185.jpg -rw------- 1 ori users 2897 May 11 23:52 clementine-art-rS1130.jpg -rw------- 1 ori users 2897 Jun 12 12:18 clementine-art-SO1125.jpg or srwxr-xr-x 1 ori users 0 Jun 12 12:09 qtsingleapp-homeor-67d0-3e8= -rw-r--r-- 1 ori users 0 May 2 12:31 qtsingleapp-homeor-67d0-3e8-lockfile -rw-r--r-- 1 ori users 0 May 2 20:50 qtsingleapp-smplay-ca73-3e8-lockfile How can this be possible? The only possibility is that the cleanup is not executed at boot, but eventually during the uptime (for sure not within 10 minutes from the boot, the time I waited before rebooting and changing bios time). But this leads to: is it safe to remove /tmp/systemd-private-* via R /tmp/systemd-private-* or may this lead to problems? Moreover, the current status is: ori@orodruin:~> cat /etc/tmpfiles.d/tmp.conf # Clear tmp directories separately, to make them easier to override d /tmp 1777 root root 2d d /var/tmp 1777 root root 30d so, how is it possible that /tmp still contains the empty directory: drwx------ 2 ori users 4096 Apr 28 08:47 gpg-sKcjuY/
Or, in general, how can I override an "X" in a system provided file?
Copy file under /etc/tmpfiles.d and edit it. This is also documented in man tmpfiles.d
But the manpage does not document my other question, that you have removed from your quote. Moreover, can someone explain me the rationale of the following construction: d /tmp 1777 root root 2d where, by the manpage, d: Create a directory if it doesn't exist yet D: Create or empty a directory So, by using d, one is allowed to expect that the directory is created if missing, and nothing is done if the directory is already there. Otherwise, what is the difference between d and D? Then there is the Age field: The date field, when set, is used to decide what files to delete when cleaning. If a file or directory is older than the current time minus the age field it is deleted. So, how can this be related to a d, that just creates a directory if not existing? Since the age has meaning, as written, for cleaning operation, I would expect this to be related to an r or R operation (and to some extend also D), not to a d. You may point to: "The age field only applies to lines starting with d, D and x. If omitted or set to - no automatic clean-up is done." but still how can you infer that files are removed when you use a d? If original file uses a D, I would agree that this makes sense, since D empties the directory, if existing, so an age may have the following meaning: Create a directory or empty it (limited to content older than age). Now I try to use the following orodruin:~ # cat /etc/tmpfiles.d/tmp.conf # Clear tmp directories separately, to make them easier to override d /tmp 1777 root root 10d d /var/tmp 1777 root root 30d x /tmp/systemd-private-* - - - 2d x /var/tmp/systemd-private-* - - - 2d and see whether I obtain the wanted behavior. Best, Andrea -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org