Skip to content

Commit

Permalink
More on virtual X11 client
Browse files Browse the repository at this point in the history
  • Loading branch information
snoweye committed Jul 18, 2017
1 parent c414346 commit da4c1e4
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 14 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ export(RPC.RR)
export(check_cs)
export(check_exec)
export(check_rr)
export(checkx_rr)
export(find_plink)
export(kill_cs)
export(kill_rr)
export(killx_rr)
export(machine)
export(plink)
export(rpc)
Expand Down
22 changes: 14 additions & 8 deletions R/111_control.r
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
#'
# #' @param unix,macos,windows
#'
#' @param check,kill,start,startx,preload
#' @param check,kill,start,preload,checkx,killx,startx
#' RPC remoter commands used by \code{\link{check_rr}()},
#' \code{\link{kill_rr}()}, or \code{\link{start_rr}()}.
#' \code{\link{kill_rr}()}, or \code{\link{start_rr}()} and
#' virtual X11 related versions \code{\link{checkx_rr}()},
#' \code{\link{killx_rr}()}, or \code{\link{startx_rr}()}..
#' RPC pbdCS commands used by \code{\link{check_cs}()},
#' \code{\link{kill_cs}()}, or \code{\link{start_cs}()}.
#'
Expand Down Expand Up @@ -103,18 +105,22 @@ RPC.LI <- function(
#' @export
#' @rdname zz_rpc_control
RPC.RR <- function(
check = "ps ax|grep '[r]emoter::server'",
kill = "kill -9 $(ps ax|grep '[r]emoter::server'|awk '{print $1}')",
check = "ps axww|grep '[r]emoter::server'",
kill = "kill -9 $(ps axww|grep '[r]emoter::server'|awk '{print $1}')",
start = "nohup Rscript -e 'remoter::server()' > .rrlog 2>&1 < /dev/null &",
startx = "nohup xvfb-run Rscript -e 'remoter::server()' > .rrlog 2>&1 < /dev/null &",
preload = "source ~/work-my/00_set_devel_R; "
preload = "source ~/work-my/00_set_devel_R; ",
checkx = "ps axww|grep '[r]emoter::server\\|[x]vfb-run'",
killx = "kill -9 $(ps axww|grep '[r]emoter::server\\|[x]vfb-run'|awk '{print $1}')",
startx = "nohup xvfb-run Rscript -e 'remoter::server()' > .rrlog 2>&1 < /dev/null &"
){
list(
check = check,
kill = kill,
start = start,
startx = startx,
preload = preload
preload = preload,
checkx = checkx,
killx = killx,
startx = startx
)
}

Expand Down
31 changes: 31 additions & 0 deletions R/rpc_rr_example.r
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
#' Lunix/unix commands \code{ps}, \code{grep}, \code{awk}, and \code{kill}
#' are used.
#'
#' \code{checkx_rr()}, \code{killx_rr()}, and \code{startx_rr()} are functions
#' with virtual X11 windows.
#'
#' @param machine
#' A machine configuration. See \code{?machine}.
#' @param preload
Expand Down Expand Up @@ -88,6 +91,20 @@ check_rr <- function(machine, cmd = .pbd_env$RPC.RR$check)
}


#' @rdname rpc_rr_example
#' @export
checkx_rr <- function(machine, cmd = .pbd_env$RPC.RR$checkx)
{
check.is.machine(machine)

ret <- suppressWarnings(
rpc(cmd = cmd, machine = machine)
)

invisible(ret)
}


#' @rdname rpc_rr_example
#' @export
kill_rr <- function(machine, cmd = .pbd_env$RPC.RR$kill)
Expand All @@ -102,6 +119,20 @@ kill_rr <- function(machine, cmd = .pbd_env$RPC.RR$kill)
}


#' @rdname rpc_rr_example
#' @export
killx_rr <- function(machine, cmd = .pbd_env$RPC.RR$killx)
{
check.is.machine(machine)

ret <- suppressWarnings(
rpc(cmd = cmd, machine = machine)
)

invisible(ret)
}


#' @rdname rpc_rr_example
#' @export
start_rr <- function(machine, cmd = .pbd_env$RPC.RR$start,
Expand Down
9 changes: 9 additions & 0 deletions man/rpc_rr_example.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions man/zz_rpc_control.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit da4c1e4

Please sign in to comment.