The relevant line from fstab is:
tmpfs /tmp tmpfs noatime 0 2
Now any program that writes to /tmp will be writing to a RAM disk, thus sparing unnecessary wear on my SSD.The relevant line from fstab is:
tmpfs /tmp tmpfs noatime 0 2
Now any program that writes to /tmp will be writing to a RAM disk, thus sparing unnecessary wear on my SSD. $ ls -ld /dev/shm
drwxrwxrwt 3 root root 120 Jun 32 02:47 /dev/shm/
Incidentally, "30 years ago" is the cutoff date for music being considered the oldies. This just made me realize Nevermind is now an oldie, and soon The Lonesome Crowded West will be too.You are relying on random implementation details instead of universal APIs that work across OSes and environments. Please stop.
So help me God, if I make a Linux system, I will make it _not_ have a /dev/shm just to avoid people relying on non-standard stuff for no good reason. Honestly, it's because of stuff like this that we need Docker.
I'm not really seeing a right or wrong here anyway unless you're distributing a script that's meant to run on all sorts of Linux systems. In which case you probably aren't concerned with the physical storage medium being used.
> Usually, it is a better idea to use memory mapped files in /run/ (for system programs) or $XDG_RUNTIME_DIR (for user programs) instead of POSIX shared memory segments, since these directories are not world-writable and hence not vulnerable to security-sensitive name clashes.
$XDG_RUNTIME_DIR usually points to /run/user/${uid}, so you're guaranteed that other users won't write there, and possibly won't even be able to read there.
https://pubs.opengroup.org/onlinepubs/9799919799/
It doesn't get more standard than that.
It's because of people doing random nonstandard shit that we need to Docker-ize a lot of software these days. People refuse to lift a single finger to adhere to conventions that let programs co-exist without simulating a whole god damn computational universe for each damn program.
It doesn't say anything about what it's backed by.
Back in the day you might place /tmp in a good spot for random access of small files on a disk platter. /var is vaguely similar but intended for things that need to be persistent.
Anyway it's not uncommon for systems to persist /tmp and clean it periodically from cron using various retention heuristics.
Ultimately POSIX concepts of mountpoints are strongly tied to optimizing spinning rust performance and maintenance and not necessarily relevant for SSD/NVME.