From 0a36ef9562a31f58f02cc02aced55e6b8cb58193 Mon Sep 17 00:00:00 2001 From: Henrik Bengtsson Date: Tue, 20 Aug 2024 12:47:09 -0700 Subject: [PATCH 1/5] Bump develop version [ci skip] --- NEWS.md | 5 +++++ bin/rsc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 842f03d..4efb92f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +## Version (development version) + + * ... + + ## Version 0.16.1 [2024-08-20] ### Miscellaneous diff --git a/bin/rsc b/bin/rsc index 0f045b4..45fce3c 100755 --- a/bin/rsc +++ b/bin/rsc @@ -63,7 +63,7 @@ ### rsc config --full ### rsc log ### -### Version: 0.16.1 +### Version: 0.16.1-9000 ### Copyright: Henrik Bengtsson (2022-2024) and Harry Putnam (2022) ### License: ISC From 4bb99e3abb7c8ae5608d51d8556174e3af4d7e7b Mon Sep 17 00:00:00 2001 From: hb Date: Wed, 21 Aug 2024 11:45:53 -0700 Subject: [PATCH 2/5] Now `rsc log` produces more informative warnings regarding on what host it thinks RStudio is running and the current machine --- NEWS.md | 5 ++++- bin/rsc | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 4efb92f..8cbb3de 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,9 @@ ## Version (development version) - * ... +### Miscellaneous + + * Now `rsc log` produces more informative warnings regarding on what + host it thinks RStudio is running and the current machine. ## Version 0.16.1 [2024-08-20] diff --git a/bin/rsc b/bin/rsc index 45fce3c..cd05cdf 100755 --- a/bin/rsc +++ b/bin/rsc @@ -63,7 +63,7 @@ ### rsc config --full ### rsc log ### -### Version: 0.16.1-9000 +### Version: 0.16.1-9001 ### Copyright: Henrik Bengtsson (2022-2024) and Harry Putnam (2022) ### License: ISC @@ -521,7 +521,7 @@ function warn_if_check_pid_needs_ssh { local hostname hostname=${1:-?} if ${ssh} && [[ "${hostname}" != "$(hostname)" ]]; then - warn "Needs to SSH to ${hostname} to check whether process ${pid} is still alive. If you don't have SSH key authentication set up, you will be asked to enter your account password below." + warn "Needs to SSH to ${hostname} to check whether process ${pid} is still alive. If you don't have SSH key authentication set up, you will be asked to enter your account password below. The current machine is $(hostname)" fi } From 704c5b7d066430070e39a569c8c164cb3ed65e3a Mon Sep 17 00:00:00 2001 From: hb Date: Wed, 21 Aug 2024 11:58:30 -0700 Subject: [PATCH 3/5] Now 'rsc --debug' reports also on internal _RSC_RSERVER_NNN_ env vars. Internal warn_if_check_pid_needs_ssh() now takes PID and HOSTNAME as arguments --- bin/rsc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/rsc b/bin/rsc index cd05cdf..587b60b 100755 --- a/bin/rsc +++ b/bin/rsc @@ -386,7 +386,7 @@ function remove_stray_pid_file { mdebug " - hostname=$(hostname)" ## If this process is not running, remove the PID file - warn_if_check_pid_needs_ssh "${rserver_hostname}" + warn_if_check_pid_needs_ssh "${pid}" "${rserver_hostname}" mapfile -t res < <(check_pid "${pid}" "${rserver_hostname}" 2>&1) okay=$? mdebug " - check_pid('${pid}', '${rserver_hostname}') exit code: ${okay}, output='$(printf "%q" "${res[*]}")'" @@ -518,8 +518,10 @@ function parse_revtunnel { } function warn_if_check_pid_needs_ssh { + local -i pid local hostname - hostname=${1:-?} + pid=${1:-?} + hostname=${2:-?} if ${ssh} && [[ "${hostname}" != "$(hostname)" ]]; then warn "Needs to SSH to ${hostname} to check whether process ${pid} is still alive. If you don't have SSH key authentication set up, you will be asked to enter your account password below. The current machine is $(hostname)" fi @@ -683,7 +685,7 @@ function rs_process_status { ## Check if PID is still active? if [[ ${pid} -ne 0 ]]; then - warn_if_check_pid_needs_ssh "${hostname}" + warn_if_check_pid_needs_ssh "${pid}" "${hostname}" mapfile -t res < <(check_pid "${pid}" "${rserver_hostname}" 2>&1) okay=$? mdebug " - check_pid('${pid}', '${rserver_hostname}') exit code: ${okay}, output='$(printf "%q" "${res[*]}")'" @@ -1613,6 +1615,10 @@ mdebug "RSC_RSESSION_TIMEOUT: ${RSC_RSESSION_TIMEOUT:-}" mdebug "RSC_SSH: ${RSC_SSH:-}" mdebug "RSC_SSH_LOGIN_HOSTNAME: ${RSC_SSH_LOGIN_HOSTNAME:-}" mdebug "RSC_SSH_TIMEOUT: ${RSC_SSH_TIMEOUT:-}" +mdebug "_RSC_RSERVER_HOSTNAME_: ${_RSC_RSERVER_HOSTNAME_:-}" +mdebug "_RSC_RSERVER_PORT_: ${_RSC_RSERVER_PORT_:-}" +mdebug "_RSC_RSERVER_PID_: ${_RSC_RSERVER_PID_:-}" +mdebug "_RSC_RSERVER_DATA_DIR_: ${_RSC_RSERVER_DATA_DIR_:-}" mdebug "args: [n=${#args[@]}] ${args[*]}" ## Enable terminal colors, if supported From 94708a8597c0073c261f8003dae922fa1e72b730 Mon Sep 17 00:00:00 2001 From: hb Date: Wed, 21 Aug 2024 12:08:46 -0700 Subject: [PATCH 4/5] Give timestamp information on the internal 'rserver.hostname' file in warning --- NEWS.md | 4 ++++ bin/rsc | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 8cbb3de..3938dbe 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,10 @@ ### Miscellaneous + * Now `rsc log` and `rsc stop` give timestamp information on the + internally recorded RStudio hostname, whenever they produce a + warning. + * Now `rsc log` produces more informative warnings regarding on what host it thinks RStudio is running and the current machine. diff --git a/bin/rsc b/bin/rsc index 587b60b..f8f7eff 100755 --- a/bin/rsc +++ b/bin/rsc @@ -63,7 +63,7 @@ ### rsc config --full ### rsc log ### -### Version: 0.16.1-9001 +### Version: 0.16.1-9003 ### Copyright: Henrik Bengtsson (2022-2024) and Harry Putnam (2022) ### License: ISC @@ -377,7 +377,7 @@ function remove_stray_pid_file { ## Nothing to do? file="${workdir}/rserver.hostname" - mdebug " - rserver hostname file=${file}" + mdebug " - rserver hostname file=${file} [$(file_info "${file}")]" [[ ! -f "${file}" ]] && return 0; ## Get rserver hostname @@ -386,7 +386,7 @@ function remove_stray_pid_file { mdebug " - hostname=$(hostname)" ## If this process is not running, remove the PID file - warn_if_check_pid_needs_ssh "${pid}" "${rserver_hostname}" + warn_if_check_pid_needs_ssh "${pid}" "${rserver_hostname}" " [${file}: $(file_info "${file}")]" mapfile -t res < <(check_pid "${pid}" "${rserver_hostname}" 2>&1) okay=$? mdebug " - check_pid('${pid}', '${rserver_hostname}') exit code: ${okay}, output='$(printf "%q" "${res[*]}")'" @@ -520,10 +520,12 @@ function parse_revtunnel { function warn_if_check_pid_needs_ssh { local -i pid local hostname + local info pid=${1:-?} hostname=${2:-?} + info=${3} if ${ssh} && [[ "${hostname}" != "$(hostname)" ]]; then - warn "Needs to SSH to ${hostname} to check whether process ${pid} is still alive. If you don't have SSH key authentication set up, you will be asked to enter your account password below. The current machine is $(hostname)" + warn "Needs to SSH to ${hostname} to check whether process ${pid} is still alive${info}. If you don't have SSH key authentication set up, you will be asked to enter your account password below. The current machine is $(hostname)" fi } @@ -1798,7 +1800,8 @@ elif [[ "${action}" == "stop" ]]; then lockfile=${workdir}/pid.lock ## If running, make sure we're stopping from the correct machine if [[ -f "${lockfile}" ]] && [[ "$(hostname)" != "$(rserver_hostname)" ]]; then - error "Stopping the RStudio Server can only be made from the machine ($(rserver_hostname)) where it was started from - not from $(hostname)" + file="${workdir}/rserver.hostname" + error "Stopping the RStudio Server can only be made from the machine ($(rserver_hostname)) where it was started from - not from $(hostname) [${file}: $(file_info "${file}")]" fi ## Terminate rsession From 09099dbbf00308732fdbec39496fb964529cb266 Mon Sep 17 00:00:00 2001 From: Henrik Bengtsson Date: Wed, 21 Aug 2024 12:19:18 -0700 Subject: [PATCH 5/5] rsc 0.16.2 --- NEWS.md | 2 +- README.md | 10 +++++----- bin/rsc | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/NEWS.md b/NEWS.md index 3938dbe..e8ab7f0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -## Version (development version) +## Version 0.16.2 [2024-08-21] ### Miscellaneous diff --git a/README.md b/README.md index 2de863e..b6debf6 100644 --- a/README.md +++ b/README.md @@ -333,12 +333,12 @@ As before, the RStudio Server is available at ```sh $ cd /path/to/software -$ curl -L -O https://github.com/UCSF-CBI/rstudio-server-controller/archive/refs/tags/0.16.1.tar.gz -$ tar xf 0.16.1.tar.gz -$ PATH=/path/to/softwarerstudio-server-controller-0.16.1/bin:$PATH +$ curl -L -O https://github.com/UCSF-CBI/rstudio-server-controller/archive/refs/tags/0.16.2.tar.gz +$ tar xf 0.16.2.tar.gz +$ PATH=/path/to/softwarerstudio-server-controller-0.16.2/bin:$PATH $ export PATH $ rsc --version -0.16.1 +0.16.2 ``` To verify that the tool can find R and the RStudio Server executables, @@ -346,7 +346,7 @@ call: ```sh $ rsc --version --full -rsc: 0.16.1 +rsc: 0.16.2 RStudio Server: 2023.06.2+561 (Mountain Hydrangea) for Linux [/path/to/rstudio-server/bin/rstudio-server] R: 4.3.1 (2023-06-16) -- "Shortstop Beagle" [/path/to/R/bin/R] ``` diff --git a/bin/rsc b/bin/rsc index f8f7eff..4873c15 100755 --- a/bin/rsc +++ b/bin/rsc @@ -63,7 +63,7 @@ ### rsc config --full ### rsc log ### -### Version: 0.16.1-9003 +### Version: 0.16.2 ### Copyright: Henrik Bengtsson (2022-2024) and Harry Putnam (2022) ### License: ISC