1

In Python, one can process SIGTERM using an answer like the one here: How to process SIGTERM signal gracefully?.

How can we do the same thing in R?

Alpha Bravo
  • 170
  • 12

1 Answers1

1

My own investigations have shown that none of the usual mechanisms (on.exit(), reg.finalizer(), or the .Last() handler) are triggered when R receives SIGTERM.

I wrote a very small, silly package to circumvent R's behaviour by installing a signal handler directly: https://github.com/atheriel/sigterm.

But it's probably worth bringing this up with the R developers as well.

Atheriel
  • 61
  • 4