From edd at debian.org  Wed Apr 26 15:40:38 2017
From: edd at debian.org (Dirk Eddelbuettel)
Date: Wed, 26 Apr 2017 08:40:38 -0500
Subject: [Rd] tempdir() may be deleted during long-running R session
In-Reply-To: <70f538a9-e9de-1282-455e-f6fda02ef778@gmail.com>
References: <c78e9022-04c2-3cda-5898-dceec8bc5e94@helsinki.fi>
 <15e3b0a3-e0a8-2da8-27c4-9268a5751986@stats.ox.ac.uk>
 <4f0797c5-a078-67ae-3992-cd66a82b454a@helsinki.fi>
 <22777.65060.465733.160015@max.eddelbuettel.com>
 <20170421173446.GB20737@ofb.net>
 <22780.46838.39255.710673@max.eddelbuettel.com>
 <22783.11355.51121.660887@stat.math.ethz.ch>
 <ea6a1fb2067a4c98b113c878789faf9f@exchsrv2.sgc.loc>
 <20170426041358.GD20737@ofb.net>
 <22784.22675.947702.198651@stat.math.ethz.ch>
 <70f538a9-e9de-1282-455e-f6fda02ef778@gmail.com>
Message-ID: <22784.41815.145.736132@max.eddelbuettel.com>


On 26 April 2017 at 08:29, Duncan Murdoch wrote:
| This seems like the wrong approach.  The problem occurs as soon as the 
| tempdir() gets cleaned up:  there could be information in temp files 
| that gets lost at that point.  So the solution should be to prevent the 
| cleanup, not to continue on after it has occurred (as "check = TRUE" 
| does).  This follows the principle that it's better for the process to 
| always die than to sometimes silently produce incorrect results.

That is generally true, but also "hard" as we don't have a handle on the OS.

| Frederick posted the way to do this in systems using systemd.  We should

While that was a very helpful post yet it may only apply to Arch Linux as
stated.  My Ubuntu systems at home and work all run systemd too, but do _not_
automatically remove tempfiles. 

Yet what he suggested is quite right: we should define a proper config file
for this facility and then possibly also use the /run directory as many other
services now and (of course) also either TEMPDIR or later the code to have
/run be another fallback if TMP, TEMP, TMPDIR, ... are unset.

Distribution maintainers such as yours truly could then include this
configuration.

| be putting that in place, or the equivalent on systems using other 
| tempfile cleanups.  This looks to me like something that "make install" 
| should do, or perhaps it should be done by people putting together 
| packages for specific systems.

Doesn't 'make install' only write to $RHOME/ and below, plus $PREFIX/bin ?

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



[Rd] tempdir() may be deleted during long-running R session
Dirk Eddelbuettel