6 ms·
Minor disagreement about the following: "Everyone must worry about whether their files need to survive a reboot" I believe there was never such expectation of
by praptak 14y ago
Minor disagreement about the following: "Everyone must worry about whether their files need to survive a reboot"
I believe there was never such expectation of /tmp. On many systems it's being wiped periodically or even when the user's last session ends. The example app(s) that use /tmp for drafts need(s) to be fixed.
- alexchamberlain 14y agoTotally agree, /tmp should be wiped at the end of each session.
- sliverstorm 14y agoAgreed; this prevents establishment of expectations otherwise.
- alexchamberlain 14y agoAlso prevents it filling up your disk.
- dredmorbius 14y agoThe key is that it may be wiped. Files stored in /tmp are not guaranteed to survive boot. Whether or not they are there or not is a bit of a gamble (a regularly losing one should you choose tmpfs).
- mccabe 14y agoSurely thats what /var/tmp is intended for.
- sehrope 14y agoThis is exactly what I use it for on my desktop. I have any app that I don't want to maintain longterm history for it's internal files (ex: Firefox browser cache) pointed to /tmp (mounted as tmpfs). As an added bonus if you're running your OS on an SSD (which you should be) you don't have it thrashed by constant writes/deletes. The memory size issue is basically a non-issue at this point (pair of desktop 16 GB DIMMS are ~$80 and laptop isn't that much more).
- RobAley 14y agoThe memory size issue is very much still an issue. I happen to have globs of memory on my machine, but for the very reason that I have software to use it. If large tmp files start eating into the resources available to my programs, its an issue for me. Also, older hardware that has less memory available, and even newer hardware that can have more memory installed but with non-tech users who don't know how to upgrade it or even that its possible (or can't afford $80).
- vidarh 14y agoIf it's an issue for you, you can simply umount the tmpfs and remove the entry for fstab. I think this is a good default - on all mystems these days, it's disk-io that's the killer, not running out of memory.
- rwmj 14y agoSure, but if the power goes down, there's at least a chance that I may be able to find that long email I was writing. With /tmp on tmpfs, it's gone.
- colanderman 14y agoThat's why the GP considers mutt broken. Drafts should be stored in ~/.mutt or /var, not /tmp. Files in /tmp should not be expected to survive a process.
- rwmj 14y agoThis is exactly the point of the posting. Every program has to be examined for this problem, and it forces a complex decision about the storage hierarchy onto every programmer.
- saurik 14y agoThat's like saying "RAM considered harmful", because every time a developer has to think "do I just store this in memory, or do I sync it to disk" "it forces a complex decision about the storage hierarchy": /tmp is simply RAM that has the API of a file; it used to be implemented using a horrible kludge with files on disk that were periodically deleted, but with tmpfs the dream became a reality.
- prodigal_erik 14y agoRAM really is a harmful kludge. Neither Turing machines nor lambda calculus call for some of an algorithm's state to suddenly be obliterated. The only reason we put up with it is that disk and SSD are so much slower.
- rwallace 14y agoSpeed is not the only benefit of RAM. The internal data structures of most programs are gnarly messes of intertwined pointers, fragile, easily corrupted, hard to upgrade in place, almost impossible to fix when they break. The division between RAM and disk forces everything to be serialized at intervals to clean storage formats that can be reread for a fresh start. As a practical matter, that's a big enough benefit to justify enforcing the division at an API level even if disk were as fast as RAM.
- ps2000 14y agoI remember myself creating cron jobs to free wasted /tmp space
- jaylevitt 14y agoI can verify this - on my Fedora 12 box, I accidentally set up a test MySQL database into /tmp. The test database grew into my blog, and it worked great till I rebooted. Then I learned lots about recovering data. (I make regular backups, of coures, but who backs up /tmp?)