Mounting /tmp at TMP or TEMP as a last resort

Earl Chew echew@ixiacom.com
Thu Sep 9 16:37:00 GMT 2010


On 09/09/2010 12:50 AM, Corinna Vinschen wrote:
> Apart from changing /etc/fstab or /etc/fstab.d/$USER by some installer
> script, why not just add a one-liner profile script along the lines of
> 
>  /etc/profile.d/tmp-mnt.sh:
> 
>    mount -f `cygpath -m "${TEMP}"` /tmp

That's a pretty good idea.

Some differences I can think of:

a. I suspect this will only be executed by an interactive shell (or one
   with the right triggering command line options).

b. Other shells (eg tcsh) might have other ideas.

c. It won't be successful if the first invoked program is not a shell.


I also believe that bash(1) complains if /tmp is not available. This
would occur prior to executing the mount. A minor issue.


We've used Cygwin for a long time and haven't had the need to
use an installer script in the past.

Admittedly issues with the mount table (way back from 19.1!) have
always caused some difficulty which we've muddled around, but
the recent behaviour with the automounting of /usr/bin and /usr/lib
with respect to the installation root is a great innovation which
has made all those problems simply go away.


Given that TMP and TEMP are standard Windows environment variables:

	http://technet.microsoft.com/en-us/library/ee156595.aspx

it seemed reasonable to have /tmp be equivalent as a default case.


This approach has a side-effect of personalizing the location
of temporary files because each user has a different setting for
TMP (and TEMP).


Earl



More information about the Cygwin-patches mailing list