From sbm at enfor.dk  Wed Mar 23 09:37:17 2011
From: sbm at enfor.dk (Stig B. Mortensen)
Date: Wed, 23 Mar 2011 09:37:17 +0100 (CET)
Subject: [Rd] Suggestion: "kill -USR1 pid" should respect --no-save option
Message-ID: <774849316.6707.1300869437772.JavaMail.root@external>

If R is killed with "kill -USR1 pid" it will terminate and save its workspace overwriting any exiting .RData-file even if R has been started with the --no-save option. Preferably R should always respect the --no-save option and this should thus be used to determine if the workspace is saved when receiving the USR1 signal.

The following change will adopt this behavior (based on R-2.12.2 source).

$RHOME/src/main/errors.c, line 147
-    R_CleanUp(SA_SAVE, 2, 1); /* quit, save,  .Last, status=2 */
+    R_CleanUp(SA_DEFAULT, 2, 1); /* quit, save,  .Last, status=2 */

$RHOME/src/main/errors.c, line 197
-    R_CleanUp(SA_NOSAVE, 0, 0);
+    R_CleanUp(SA_DEFAULT, 0, 0);

The documentation in $RHOME/src/library/base/man/unix/Signals.Rd should also be updated accordingly.

To my knowledge it is not possible to send a USR1/USR2 signal on windows so this issue is only relevant on POSIX compliant systems.

Best regards,
Stig B. Mortensen



[Rd] Suggestion: "kill -USR1 pid" should respect --no-save option
Stig B. Mortensen