Restarting Rstudio Server in Docker: Avoid Error Message

rstudio

#1

I'm running Rstudio (preview) in a Docker container on macOS and Windows. I'm using a bash script to make it easier to start/stop the container. This is working very nicely, except that each time I stop (kill) the docker process and start it back up again, Rstudio shows an error message that the "session was abnormally terminated".

Is there a way to avoid this message from showing up? e.g., by removing a file in the .rstudio directory before startup?


image


#2

Yes, there is. There's a file called session-persistent-state in ~/.rstudio/sessions/active/session-XXXXXXXX, with a flag:

abend="1"

If you change that 1 to 0, it'll turn off the warning.

Hope this helps!


#3

Excellent! Thanks @jonathan!

In case someone ever needs something similar ... I used the following code in the script to search-and-replace abend="1" to abend="0"

find ~/.rstudio/sessions/active/*/session-persistent-state -type f | xargs sed -i '' -e 's/abend="1"/abend="0"/'