Rstudio server tmp directory cleanup


We are currently trying to get RStudio server rolled out to our researchers we have managed to get it running with the following modules setup:

  • R/3.5.3
  • rstudio-server/1.2.1335
  • rstudio_singularity/3.5.3
  • singularity/3.1.1

Once the session has ended we are left with the file in /tmp (mode 0700), is there something we are missing to come and clean up these tmp files or do we have to manually do this?



@09wattry without knowing more about your implementation, I do not know what file you are talking about. If you followed the bc_example_rstudio example then I would expect that there would only be the directory at $(mktemp -d).

There are a few options for cleanup but they may be scheduler dependent. At OSC with our Torque-based cluster we use epilogue scripts to clean up after users.



I checked quickly for the ability to run epilogues with all our supported schedulers:



Hi there

I apologize for the vague question. I did not write the plugin for our RStudio application but I have been told that we used the bc_osc_rstudio_server plugin as a base to start so we had to make a few changes to get it working in our env. The files I am referring too are the mktemp files when the user starts a rstudio server session, created by the plugin script.

We have move to Slurm so we are still feeling it out. Thanks for the epilogue links, it looks like we have implemented some for xfce clean up.



If you are using Slurm then I think that epilogue scripts are the way to go. Yesterday I tried a few things using our Slurm development environment: adding a cleanup script at $PLUGIN_BASE/template/ which is called automatically at the end of an interactive app (docs), and trying to run a trap function on SIGINT and SIGTERM. Unfortunately I found that scancel was killing the job in a way that did not allow the clean up handlers to run.

1 Like