Hello everyone!
I wonder whether any other application does a similar thing? /usr/bin/firefox contains this nasty piece:
## ## Use $MOZ_TMPDIR if set. Otherwise use /var/tmp instead of /tmp ## because of 1GB /tmp limit in Fedora 18 and later. ## See: https://bugzilla.redhat.com/show_bug.cgi?id=867073 ## TMPDIR="${MOZ_TMPDIR:-/var/tmp}" export TMPDIR
Originally, it had hardcoded TMPDIR to /var/tmp already, overriding the users TMPDIR setting (if any) - https://bugzilla.redhat.com/867073 - and passing that altered env to programs it starts, too.
The Firefox source would respect TMPDIR, TEMP and TMP, then fall back to /tmp if no env var is set.
Searching a bit in Fedora Wiki pages, I've found:
http://fedoraproject.org/wiki/Features/tmp-on-tmpfs
| My CD burning application writes huge .iso files to /tmp, | and this breaks on tmpfs!
The application should be fixed to use /var/tmp.
| My application writes temporary files to /tmp and they are | gone after a reboot!
The application should be fixed to use /var/tmp. FHS recommends that /tmp is flushed on reboot, and that's what we do here.
It is insane to hardcode /var/tmp. Also, GNOME Shell (F19) here defaults to /tmp, and I guess other parts of the OS do too, not only if they use glib2 (g_get_tmp_dir() or similar).
## Use $MOZ_TMPDIR if set. Otherwise use /var/tmp instead of /tmp ## because of 1GB /tmp limit in Fedora 18 and later.
It is insane to hardcode /var/tmp.
Considering the comment, they probably think it's insane to put /tmp in RAM, and since web browsers are often used to download huge files and /tmp is the default non-hardcoded dir, they're trying to avoid users complaining about failed downloads.
Note that this is one of the cases the opponents of the tmp-in-tmpfs change predicted. No surprise that they want to avoid bug reports due to unexpected (to the user) behavior, and in fact, this is what the tmp-in-tmpfs proponents suggested (using /var/tmp) for such cases anyway.
For reference, see the very long debate about tmp-in-tmpfs.
On Thu, 2013-05-23 at 03:00 -0400, DJ Delorie wrote:
## Use $MOZ_TMPDIR if set. Otherwise use /var/tmp instead of /tmp ## because of 1GB /tmp limit in Fedora 18 and later.
It is insane to hardcode /var/tmp.
Considering the comment, they probably think it's insane to put /tmp in RAM, and since web browsers are often used to download huge files and /tmp is the default non-hardcoded dir, they're trying to avoid users complaining about failed downloads.
Doesn't Firefox download in $XDG_DOWNLOAD_DIR by default these days?
Doesn't Firefox download in $XDG_DOWNLOAD_DIR by default these days?
Depends on user's choice in download-dialog:
* open with %{app} ---> download goes to the defined %{temp}-location and launches %{app} with downloaded file.
* save ---> download goes to ${XDG_DOWNLOAD_DIR}.
Mathieu
Cheers, Björn
On Thu, 23 May 2013 03:00:51 -0400, DJ Delorie wrote:
## Use $MOZ_TMPDIR if set. Otherwise use /var/tmp instead of /tmp ## because of 1GB /tmp limit in Fedora 18 and later.
It is insane to hardcode /var/tmp.
Considering the comment, they probably think it's insane to put /tmp in RAM, and since web browsers are often used to download huge files and /tmp is the default non-hardcoded dir, they're trying to avoid users complaining about failed downloads.
There's no guarantee that /var/tmp is larger than 1 GB.
Making an application default to /var/tmp would be acceptable, if it respected $TMPDIR and didn't export the changed env var to programs it launches. In parts of the Firefox source code even $TEMP and $TMP are examined, if $TMPDIR is unset. Firefox upstream evaluates $TMPDIR. It doesn't know $MOZ_TMPDIR. Do we want $FOO_TMPDIR for every program that defaults to storing large/huge files in /tmp. Hopefully we want to make it evaluate $TMPDIR instead, or make Fedora default to /var/tmp instead of /tmp.
For reference, see the very long debate about tmp-in-tmpfs.
That one is not for ordinary human beings. ;-)