Skip to content

Commit

Permalink
Merge branch 'release/0.13.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Oct 9, 2023
2 parents 3489ca7 + 763abbc commit caa1a35
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
check: shellcheck spelling

shellcheck:
(cd bin; \
shellcheck --shell=bash --external-sources -- incl/*.sh; \
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## Version 0.13.8 [2023-10-09]

### Bug Fixes

* `rsc start` and `rsc status` would stall if the RStudio Server was
previously running on another host and that host no longer responds
on SSH. Now it will timeout with an informative error message.


## Version 0.13.7 [2023-10-04]

### Miscellaneous
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,20 +333,20 @@ 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.13.7.tar.gz
$ tar xf 0.13.7.tar.gz
$ PATH=/path/to/softwarerstudio-server-controller-0.13.7/bin:$PATH
$ curl -L -O https://github.com/UCSF-CBI/rstudio-server-controller/archive/refs/tags/0.13.8.tar.gz
$ tar xf 0.13.8.tar.gz
$ PATH=/path/to/softwarerstudio-server-controller-0.13.8/bin:$PATH
$ export PATH
$ rsc --version
0.13.7
0.13.8
```
To verify that the tool can find R and the RStudio Server executables,
call:
```sh
$ rsc --version --full
rsc: 0.13.7
rsc: 0.13.8
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]
```
Expand Down
19 changes: 13 additions & 6 deletions bin/rsc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
### rsc config --full
### rsc log
###
### Version: 0.13.7
### Version: 0.13.8
### Copyright: Henrik Bengtsson (2022-2023) and Harry Putnam (2022)
### License: ISC

Expand Down Expand Up @@ -445,6 +445,12 @@ function make_rserver_conf {
# -------------------------------------------------------------------------
# Misc. utilities
# -------------------------------------------------------------------------
function ssh_timeout {
local timeout=${RSC_SSH_TIMEOUT:-15}
assert_integer "${timeout}"
echo "${timeout}"
}

function parse_revtunnel {
local spec
local hostname
Expand All @@ -469,6 +475,7 @@ function check_pid {
local hostname
local pid_exists
local asterisk
local timeout

## If 'pid' is assigned an empty value, then it becomes pid=0,
## because we declared it as an integer above.
Expand All @@ -486,9 +493,9 @@ function check_pid {
mdebug "- Checking /proc/${pid} on current machine (${hostname})"
[[ -d "/proc/${pid}" ]] && pid_exists=true
elif ${ssh}; then
mdebug "- Checking /proc/${pid} on ${hostname} over SSH"
mdebug "- Checking /proc/${pid} on ${hostname} over SSH ($(ssh_timeout)-second timeout)"
#shellcheck disable=SC2029
res=$(ssh "${hostname}" "[[ -d '/proc/${pid}' ]] && echo true || echo false") || error "Failed to check process PID ${pid} on ${hostname} over SSH"
res=$(ssh -o ConnectTimeout="$(ssh_timeout)" "${hostname}" "[[ -d '/proc/${pid}' ]] && echo true || echo false" 2>&1) || error "Failed to check process PID ${pid} on ${hostname} over SSH. Reason was: ${res}"
[[ "${res}" == "true" ]] && pid_exists=true
else
mdebug "- Skipping check of /proc/${pid} on ${hostname}, because --no-ssh"
Expand Down Expand Up @@ -1707,12 +1714,12 @@ elif [[ "${action}" == "start" ]]; then

pid_file=$(ssh_revtunnel_pid_file)
if $dryrun; then
echo "DRYRUN: ssh -N -R \"${rev_spec}\" \"${rev_hostname}\""
echo "DRYRUN: ssh -o ConnectTimeout=\"$(ssh_timeout)\" -N -R \"${rev_spec}\" \"${rev_hostname}\""
sleep 60 &
else
mdebug "ssh -N -R \"${rev_spec}\" \"${rev_hostname}\""
mdebug "ssh -o ConnectTimeout=\"$(ssh_timeout)\" -N -R \"${rev_spec}\" \"${rev_hostname}\""
printf "%s\n%s\n" "${rev_hostname}" "${rev_port}" > "$(ssh_revtunnel_spec_file)"
ssh -N -R "${rev_spec}" "${rev_hostname}" &
ssh -o ConnectTimeout="$(ssh_timeout)" -N -R "${rev_spec}" "${rev_hostname}" &
fi
ssh_pid=$!
echo "${ssh_pid}" > "${pid_file}"
Expand Down

0 comments on commit caa1a35

Please sign in to comment.