Launchpad Entry: server-karmic-tmp-as-tmpfs
Packages affected: swapd
This specification proposes mounting a tmpfs onto /tmp instead of leaving the contents on the root filesystem and cleaning them after every reboot.
/tmp on newly installed Ubuntu systems is now a temporary filesystem.
The contents of /tmp are not expected to survive a reboot, and in fact we spend time during boot cleaning them out. Switching to a tmpfs for /tmp gives a boot speed advantage.
There is also a security advantage, since temporary data is no longer available after the system is powered down. Combined with encrypted swap, this goes a long way to improving system security.
This assumes that software does not expect data in /tmp to last after a reboot, and uses the FHS /var/tmp directory for such data. Since Ubuntu cleans up /tmp after a reboot, this should be true.
The design assumes that the work has been done to switch to udev-based filesystem mounting, the fallback plan for this will be to defer the work rather than attempt to augment the current initscripts.
We also assume that there is an adequate tool for growing virtual memory as the contents of /tmp grow.
We will add an entry to /etc/fstab that mounts a temporary filesystem (tmpfs) onto /tmp.
If this entry is not present, the filesystem mounting tool will instead clean up /tmp as the current initscripts do.
The default limit for a tmpfs is half of the available RAM; to allow larger files to exist in /tmp we will set no limit and use a daemon such as swapd to dynamically manage virtual memory.
This is not dependant on migration to swap files, since the swap partition is also available for use; and swapd can add swap files afterwards.
No migration will be made on upgrades, instead a wiki page will document the steps that existing users may take.
Test plan should include downloading a file in Firefox (which uses /tmp) and checking the output of mount.