Skip to content

Commit 704c5b7

Browse files
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
1 parent 4bb99e3 commit 704c5b7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

bin/rsc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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}"
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,8 +518,10 @@ function parse_revtunnel {
518518
}
519519

520520
function warn_if_check_pid_needs_ssh {
521+
local -i pid
521522
local hostname
522-
hostname=${1:-?}
523+
pid=${1:-?}
524+
hostname=${2:-?}
523525
if ${ssh} && [[ "${hostname}" != "$(hostname)" ]]; then
524526
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)"
525527
fi
@@ -683,7 +685,7 @@ function rs_process_status {
683685

684686
## Check if PID is still active?
685687
if [[ ${pid} -ne 0 ]]; then
686-
warn_if_check_pid_needs_ssh "${hostname}"
688+
warn_if_check_pid_needs_ssh "${pid}" "${hostname}"
687689
mapfile -t res < <(check_pid "${pid}" "${rserver_hostname}" 2>&1)
688690
okay=$?
689691
mdebug " - check_pid('${pid}', '${rserver_hostname}') exit code: ${okay}, output='$(printf "%q" "${res[*]}")'"
@@ -1613,6 +1615,10 @@ mdebug "RSC_RSESSION_TIMEOUT: ${RSC_RSESSION_TIMEOUT:-<not set>}"
16131615
mdebug "RSC_SSH: ${RSC_SSH:-<not set>}"
16141616
mdebug "RSC_SSH_LOGIN_HOSTNAME: ${RSC_SSH_LOGIN_HOSTNAME:-<not set>}"
16151617
mdebug "RSC_SSH_TIMEOUT: ${RSC_SSH_TIMEOUT:-<not set>}"
1618+
mdebug "_RSC_RSERVER_HOSTNAME_: ${_RSC_RSERVER_HOSTNAME_:-<not set>}"
1619+
mdebug "_RSC_RSERVER_PORT_: ${_RSC_RSERVER_PORT_:-<not set>}"
1620+
mdebug "_RSC_RSERVER_PID_: ${_RSC_RSERVER_PID_:-<not set>}"
1621+
mdebug "_RSC_RSERVER_DATA_DIR_: ${_RSC_RSERVER_DATA_DIR_:-<not set>}"
16161622
mdebug "args: [n=${#args[@]}] ${args[*]}"
16171623

16181624
## Enable terminal colors, if supported

0 commit comments

Comments
 (0)