Skip to content

Commit ca03fa4

Browse files
Merge branch 'release/0.16.2'
2 parents c629e58 + 09099db commit ca03fa4

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed

NEWS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## Version 0.16.2 [2024-08-21]
2+
3+
### Miscellaneous
4+
5+
* Now `rsc log` and `rsc stop` give timestamp information on the
6+
internally recorded RStudio hostname, whenever they produce a
7+
warning.
8+
9+
* Now `rsc log` produces more informative warnings regarding on what
10+
host it thinks RStudio is running and the current machine.
11+
12+
113
## Version 0.16.1 [2024-08-20]
214

315
### Miscellaneous

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,20 +333,20 @@ As before, the RStudio Server is available at
333333
334334
```sh
335335
$ cd /path/to/software
336-
$ curl -L -O https://github.com/UCSF-CBI/rstudio-server-controller/archive/refs/tags/0.16.1.tar.gz
337-
$ tar xf 0.16.1.tar.gz
338-
$ PATH=/path/to/softwarerstudio-server-controller-0.16.1/bin:$PATH
336+
$ curl -L -O https://github.com/UCSF-CBI/rstudio-server-controller/archive/refs/tags/0.16.2.tar.gz
337+
$ tar xf 0.16.2.tar.gz
338+
$ PATH=/path/to/softwarerstudio-server-controller-0.16.2/bin:$PATH
339339
$ export PATH
340340
$ rsc --version
341-
0.16.1
341+
0.16.2
342342
```
343343
344344
To verify that the tool can find R and the RStudio Server executables,
345345
call:
346346
347347
```sh
348348
$ rsc --version --full
349-
rsc: 0.16.1
349+
rsc: 0.16.2
350350
RStudio Server: 2023.06.2+561 (Mountain Hydrangea) for Linux [/path/to/rstudio-server/bin/rstudio-server]
351351
R: 4.3.1 (2023-06-16) -- "Shortstop Beagle" [/path/to/R/bin/R]
352352
```

bin/rsc

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
### rsc config --full
6464
### rsc log
6565
###
66-
### Version: 0.16.1
66+
### Version: 0.16.2
6767
### Copyright: Henrik Bengtsson (2022-2024) and Harry Putnam (2022)
6868
### License: ISC
6969

@@ -377,7 +377,7 @@ function remove_stray_pid_file {
377377

378378
## Nothing to do?
379379
file="${workdir}/rserver.hostname"
380-
mdebug " - rserver hostname file=${file}"
380+
mdebug " - rserver hostname file=${file} [$(file_info "${file}")]"
381381
[[ ! -f "${file}" ]] && return 0;
382382

383383
## Get rserver hostname
@@ -386,7 +386,7 @@ function remove_stray_pid_file {
386386
mdebug " - hostname=$(hostname)"
387387

388388
## If this process is not running, remove the PID file
389-
warn_if_check_pid_needs_ssh "${rserver_hostname}"
389+
warn_if_check_pid_needs_ssh "${pid}" "${rserver_hostname}" " [${file}: $(file_info "${file}")]"
390390
mapfile -t res < <(check_pid "${pid}" "${rserver_hostname}" 2>&1)
391391
okay=$?
392392
mdebug " - check_pid('${pid}', '${rserver_hostname}') exit code: ${okay}, output='$(printf "%q" "${res[*]}")'"
@@ -518,10 +518,14 @@ function parse_revtunnel {
518518
}
519519

520520
function warn_if_check_pid_needs_ssh {
521+
local -i pid
521522
local hostname
522-
hostname=${1:-?}
523+
local info
524+
pid=${1:-?}
525+
hostname=${2:-?}
526+
info=${3}
523527
if ${ssh} && [[ "${hostname}" != "$(hostname)" ]]; then
524-
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."
528+
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)"
525529
fi
526530
}
527531

@@ -683,7 +687,7 @@ function rs_process_status {
683687

684688
## Check if PID is still active?
685689
if [[ ${pid} -ne 0 ]]; then
686-
warn_if_check_pid_needs_ssh "${hostname}"
690+
warn_if_check_pid_needs_ssh "${pid}" "${hostname}"
687691
mapfile -t res < <(check_pid "${pid}" "${rserver_hostname}" 2>&1)
688692
okay=$?
689693
mdebug " - check_pid('${pid}', '${rserver_hostname}') exit code: ${okay}, output='$(printf "%q" "${res[*]}")'"
@@ -1613,6 +1617,10 @@ mdebug "RSC_RSESSION_TIMEOUT: ${RSC_RSESSION_TIMEOUT:-<not set>}"
16131617
mdebug "RSC_SSH: ${RSC_SSH:-<not set>}"
16141618
mdebug "RSC_SSH_LOGIN_HOSTNAME: ${RSC_SSH_LOGIN_HOSTNAME:-<not set>}"
16151619
mdebug "RSC_SSH_TIMEOUT: ${RSC_SSH_TIMEOUT:-<not set>}"
1620+
mdebug "_RSC_RSERVER_HOSTNAME_: ${_RSC_RSERVER_HOSTNAME_:-<not set>}"
1621+
mdebug "_RSC_RSERVER_PORT_: ${_RSC_RSERVER_PORT_:-<not set>}"
1622+
mdebug "_RSC_RSERVER_PID_: ${_RSC_RSERVER_PID_:-<not set>}"
1623+
mdebug "_RSC_RSERVER_DATA_DIR_: ${_RSC_RSERVER_DATA_DIR_:-<not set>}"
16161624
mdebug "args: [n=${#args[@]}] ${args[*]}"
16171625

16181626
## Enable terminal colors, if supported
@@ -1792,7 +1800,8 @@ elif [[ "${action}" == "stop" ]]; then
17921800
lockfile=${workdir}/pid.lock
17931801
## If running, make sure we're stopping from the correct machine
17941802
if [[ -f "${lockfile}" ]] && [[ "$(hostname)" != "$(rserver_hostname)" ]]; then
1795-
error "Stopping the RStudio Server can only be made from the machine ($(rserver_hostname)) where it was started from - not from $(hostname)"
1803+
file="${workdir}/rserver.hostname"
1804+
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}")]"
17961805
fi
17971806

17981807
## Terminate rsession

0 commit comments

Comments
 (0)