Changeset: bb7f1160ef6c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bb7f1160ef6c
Modified Files:
        clients/R/MonetDB.R/R/control.R
Branch: Oct2014
Log Message:

R Connector: Added wait option to monetdb.server.stop on UNIX-like systems


Unterschiede (26 Zeilen):

diff --git a/clients/R/MonetDB.R/R/control.R b/clients/R/MonetDB.R/R/control.R
--- a/clients/R/MonetDB.R/R/control.R
+++ b/clients/R/MonetDB.R/R/control.R
@@ -69,10 +69,20 @@ monetdb.server.start <-
 
 
 monetdb.server.stop <-
-  function( correct.pid ){
+  function( correct.pid, wait=T ){
     
     if ( .Platform$OS.type == "unix" ) {
-      system(paste0("kill ",correct.pid))
+      system(paste0("kill ",correct.pid))  
+      waittime <- 2
+      if (!wait) return(TRUE)
+      Sys.sleep(1)
+      repeat {
+        psout <- system(paste0("ps ax | grep \"^", correct.pid, 
".*mserver5\""), ignore.stdout=T) 
+        if (psout != 0) break
+        message("Waiting ",waittime,"s for server shutdown (ESC or CTRL+C to 
abort)")
+        Sys.sleep(waittime)
+        waittime <- waittime * 2
+      }
     } 
     
     if ( .Platform$OS.type == "windows" ) {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to