From edd at debian.org  Wed Apr 26 17:14:13 2017
From: edd at debian.org (Dirk Eddelbuettel)
Date: Wed, 26 Apr 2017 10:14:13 -0500
Subject: [Rd] tempdir() may be deleted during long-running R session
In-Reply-To: <f537ab49-dd45-70f5-1795-1834fecd3b41@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>
 <f537ab49-dd45-70f5-1795-1834fecd3b41@gmail.com>
Message-ID: <22784.47429.833820.612654@max.eddelbuettel.com>


On 26 April 2017 at 16:39, Tomas Kalibera wrote:
| I agree this should be solved in configuration of 
| systemd/tmpreaper/whatever tmp cleaner - the cleanup must be prevented 

Yep.

| in configuration files of these tools. Moving session directories under 
| /var/run (XDG_RUNTIME_DIR) does not seem like a good solution to me, 
| sooner or later someone might come with auto-cleaning that directory too.

(These days it seems /run is used too. I seem to have a screenful of things
in there.)
 
| It might still be useful if R could sometimes detect when automated 
| cleanup happened and warn the user. Perhaps a simple way could be to 
| always create an empty file inside session directory, like 
| ".tmp_cleaner_trap". R would never touch this file, but check its 
| existence time-to-time. If it gets deleted, R would issue a warning and 
| ask the user to check tmp cleaner configuration. The idea is that this 
| file will be the oldest one in the session directory, so would get 
| cleaned up first.

That's a very good third idea.

Dirk 

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



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