Owner

Current status

Detailed Description

We'd like to mount a tmpfs on /tmp by default, but still allow administrators to opt out from this.

Solaris has been doing this since 1994. (Much like other Unixes, too.) Debian's next release defaults to tmpfs on /tmp, too. ArchLinux defaults to this as well. Ubuntu has plans for their 12.10 release.

Benefit to Fedora

By implementing this we generate less IO on disks. This increases SSD lifetime,s aves a bit of power and makes things a bit faster.

/tmp is automatically flushed at boot.

We bring Fedora closer to commercial Unixes and other Linux distributions.

We make the delta to stateless read-only systems smaller.

Scope

systemd upstream needs a minimal change to ship a mount unit for /tmp by default.

We might need to patch a couple of packages not to store big files and files needing boot persistance in /tmp, but rather in /var/tmp. This work has already progressed due to Debian's work.

How To Test

The system should boot up and work as normal. Applications should work as normal. However, /bin/mount should show /tmp to be a tmpfs. Besides that the system operates normally and a check that /tmp is actually a tmpfs there is little to test.

User Experience

The user experience should barely change. This is mostly a low-level change that has little visibility to the user.

Dependencies

None

Contingency Plan

The plan is like this:

Turn on /tmp as tmpfs very early in the Fedora 18 cycle. Fix any problems coming up, and revert back to non-tmpfs /tmp if they become too many. The revert should by fairly trivial and isolated. Just consists of dropping a unit file from the systemd package.

Documentation

Nothing really.

Release Notes

/tmp now defaults to tmpfs. This might break a few programs which assume that they can place large files in /tmp or that /tmp is persistant across boot. If these programms cannot be fixed to usr /var/tmp instead of /tmp for this, there are two options:

Disable mounting of tmpfs on /tmp by issuing "systemctl mask tmp.mount". Note that this will entirely disable any mounting of any file system to /tmp. To mount a different file system to this place instead place a configuration file like this in /etc/systemd/system/tmp.mount:

[Mount]
What=/dev/sda5
Where=/tmp
Type=ext4

Comments and Discussion

That is true, however no different as with /run or /dev/shm where unprivileged users have access too. The quota on tmpfs problem needs to be fixed in the kernel anyway, whether it is 2 or 3 file systems that are writable by normal users makes little difference.