Auto cleanup of /tmp in RHEL 7?
by akshayhb.akshay from LinuxQuestions.org on (#4X44V)
Hello,
Unlike RHEL 6 and earlier versions, starting RHEL 7 I understand that we have a new systemd unit file (systemd-tmpfiles) which does clean up of files and directories under /tmp filesystem.
I looked at the configuration file tmp.conf under /usr/lib/tmpfiles.d and as per the highlighted entry below, systemd deletes files and directories older than 30 days under /tmp and /var/tmp and auto deletion happens every day as per the file systemd-tmpfiles-clean.timer (/usr/lib/systemd/system)
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# See tmpfiles.d(5) for details
# Clear tmp directories separately, to make them easier to override
v /tmp 1777 root root 10d
v /var/tmp 1777 root root 30d
# Exclude namespace mountpoints created with PrivateTmp=yes
x /tmp/systemd-private-%b-*
X /tmp/systemd-private-%b-*/tmp
x /var/tmp/systemd-private-%b-*
X /var/tmp/systemd-private-%b-*/tmp
Please help me to understand:
a) if any log file gets created for every systemd tmp cleanup run scheduled to run daily
b) as per the man pages of tmpfiles.d, v flag indicates "Create a subvolume if the path does not exist yet and the file system supports this (btrfs). Otherwise create a normal directory, in the same way as d". But, the highlighted entry above says tmp cleanup.
Does v flag clears tmp in addition to subvolume creation?
Thanks and Regards
Akshay


Unlike RHEL 6 and earlier versions, starting RHEL 7 I understand that we have a new systemd unit file (systemd-tmpfiles) which does clean up of files and directories under /tmp filesystem.
I looked at the configuration file tmp.conf under /usr/lib/tmpfiles.d and as per the highlighted entry below, systemd deletes files and directories older than 30 days under /tmp and /var/tmp and auto deletion happens every day as per the file systemd-tmpfiles-clean.timer (/usr/lib/systemd/system)
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# See tmpfiles.d(5) for details
# Clear tmp directories separately, to make them easier to override
v /tmp 1777 root root 10d
v /var/tmp 1777 root root 30d
# Exclude namespace mountpoints created with PrivateTmp=yes
x /tmp/systemd-private-%b-*
X /tmp/systemd-private-%b-*/tmp
x /var/tmp/systemd-private-%b-*
X /var/tmp/systemd-private-%b-*/tmp
Please help me to understand:
a) if any log file gets created for every systemd tmp cleanup run scheduled to run daily
b) as per the man pages of tmpfiles.d, v flag indicates "Create a subvolume if the path does not exist yet and the file system supports this (btrfs). Otherwise create a normal directory, in the same way as d". But, the highlighted entry above says tmp cleanup.
Does v flag clears tmp in addition to subvolume creation?
Thanks and Regards
Akshay