Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move SAGE_TMP to python's tempdir #17828

Closed
a-andre opened this issue Feb 22, 2015 · 11 comments
Closed

Move SAGE_TMP to python's tempdir #17828

a-andre opened this issue Feb 22, 2015 · 11 comments

Comments

@a-andre
Copy link

a-andre commented Feb 22, 2015

SAGE_TMP is currently located in DOT_SAGE. This patch moves it to tempfile.tempdir.

This is part of #17185.

CC: @orlitzky

Component: misc

Branch/Commit: u/aapitzsch/ticket/17828 @ 32cf221

Issue created by migration from https://trac.sagemath.org/ticket/17828

@a-andre a-andre added this to the sage-6.6 milestone Feb 22, 2015
@a-andre
Copy link
Author

a-andre commented Feb 22, 2015

Commit: 32cf221

@a-andre
Copy link
Author

a-andre commented Feb 22, 2015

Branch: u/aapitzsch/ticket/17828

@jdemeyer
Copy link

comment:2

This is an important functional change which absolutely should be discussed on sage-devel first.

@jdemeyer
Copy link

comment:3

You need to consider also the security implications of this change.

@vbraun
Copy link
Member

vbraun commented Feb 22, 2015

comment:4

In principle I prefer the real tmpdir, but in practice there is some sagenb legacy crud to be considered. In particular, sagenb is potentially a very long-running server that'll rely on fixed temporary directory for the duration of the user login. Might get deleted by tmpwatch while you are on holidays. For the security part: make sure that sagenb with server_pool doesn't do anything dangerous, it creates some world-writable directories in there.

@jdemeyer
Copy link

comment:5

If you need long lived temporary files, you need /var/tmp, not /tmp on Unix.

@vbraun
Copy link
Member

vbraun commented Feb 23, 2015

comment:6

Maybe yes, maybe no. There is no guarantee that /var/tmp is not just a symlink to /tmp, though usually it is not. There is definitely no guarantee that old files are not cleaned there, too.

@jdemeyer
Copy link

comment:7

Replying to @vbraun:

Maybe yes, maybe no. There is no guarantee that /var/tmp is not just a symlink to /tmp, though usually it is not. There is definitely no guarantee that old files are not cleaned there, too.

Files in /var/tmp are supposed to survive a reboot, so I conclude from this that they would be kept alive during a running Sage session too. It is not a problem if /tmp and /var/tmp point to the same directory, as long as it's not cleaned too often.

@vbraun
Copy link
Member

vbraun commented Feb 23, 2015

comment:8

The "survive a reboot" part means that /var/tmp is supposed to be on a hdd/ssd, whereas most distributions put /tmp on a ram disk nowadays. You can count on temp files being kept alive for a few days but not forever.

@orlitzky
Copy link
Contributor

comment:9

I missed this ticket, but I've done this as part of #33213 which eliminates SAGE_TMP entirely after adjusting the library to use python's tempfile mechanisms instead.

@mkoeppe
Copy link
Member

mkoeppe commented Jul 27, 2022

Changed author from André Apitzsch to none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants