From frederik at ofb.net  Thu Apr 27 22:53:39 2017
From: frederik at ofb.net (frederik at ofb.net)
Date: Thu, 27 Apr 2017 13:53:39 -0700
Subject: [Rd] tempdir() may be deleted during long-running R session
In-Reply-To: <d053ca3a-781d-4ea9-be10-2f17b47d7cee@gmail.com>
References: <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>
 <d053ca3a-781d-4ea9-be10-2f17b47d7cee@gmail.com>
Message-ID: <20170427205339.GG17713@ofb.net>

> > 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.

It may kill two birds with one stone if we put the PID into such a
file. Then it could be used to automate the cleanup of /tmp/RtmpXXXX
directories left around from crashed R sessions (since we're about to
tell Systemd not to touch them).

I'm not sure what is meant by "R would ... check its existence
time-to-time". It doesn't sound to me like an important enough task to
go into the main event loop of the interpreter. Maybe a warning/error
in 'tempdir()' to tell us that either the directory has been deleted
or that the PID file no longer exists.

Thank you,

Frederick



[Rd] tempdir() may be deleted during long-running R session
frederik at ofb.net