I run some programs that populate /tmp and sometimes /var/tmp. These files are anywhere between 3-4GB. I will like to create /tmp and /var/tmp at boot with 777 permissions and a sticky-bit. I see a systemd linked configuration tmp.conf in /usr/lib/tmpfiles.d/ directory but it doesn’t recreate /tmp, /var/tmp. Can I replace ‘q’ with ‘d’ there?, and if I do that how I can set a sticky-bit before I log in plasmadesktop. I don’t know if the stick-bit exists by default or not. Earlier I wasn’t able to log in and I had to run chmod a=rawx,o+t on /tmp.
# cat /usr/lib/tmpfiles.d/tmp.conf
# 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
# SUSE policy: we don't clean those directories
q /tmp 1777 root root -
q /var/tmp 1777 root root -
# 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
# Remove top-level private temporary directories on each boot
R! /tmp/systemd-private-*
R! /var/tmp/systemd-private-*
I created a /etc/tmpfiles.d/tmp.conf earlier but it resulted into missing Xorg lock and I couldn’t log into plasmadesktop environment.
d /tmp 1777 root root -
d /var/tmp 1777 root root -
What is the correct strategy for clearing /tmp and /var/tmp?