Repository navigation
Commit 6e26b3c
andy
RCommand: fix csh-specific \$status in execout()/file transfer; default remote shell to bash
Second round of live testing surfaced that the login-sequence fix alone
wasn't enough: execout() -- the function every single remote command
execution goes through -- appended "; echo CMDSTAT=\$status" to check
exit status. \$status is csh/tcsh-specific; bash has no such variable
(it's simply unset there), so this silently produced an empty
"CMDSTAT=" with no digit, matching none of execout()'s success/failure
patterns and failing every remote command with "No status returned"
-- confirmed via a live standalone repro (RCommand + execout("echo
test") against a real bash connection: failed before this fix, works
correctly after). Same pattern existed in the two file-transfer sites
(shellput's dd-based upload, shellget's cat-based download). Fixed all
three using the now-correctly-tracked p_remoteBash: "\$?" for bash,
"\$status" for csh/tcsh/anything else. The downstream CMDSTAT=0/1/2
pattern matching needed no changes -- it only checks the *expanded*
numeric result, identical either way.
Also flipped RefMachine::shell()'s default from "csh" to "bash", per
explicit direction: fewer hard dependencies going forward (neither this
build machine nor niobium have tcsh installed, confirmed live), while
keeping full csh/tcsh support for any machine that sets "shell: csh" or
"shell: tcsh" explicitly in its CONFIG file. Only affects registered
remote machines (RefMachine::shell() reads a per-machine CONFIG file) --
RCommand's own constructor default and the local ("system") connection
path both still default to "csh" unchanged, since Point 1 (the local
shell) remains explicitly out of scope for now.
Known remaining gap, not fixed here: execbg() (used by Launch.C for
background job launches) also has a csh-specific pattern ("Exit*") for
detecting a background command's completion status. Lower urgency than
execout() was -- execbg()'s own documented design already treats
background-job status as best-effort/not fully reliable even for csh,
so a bash mismatch there degrades gracefully (falls through to "assume
success" on seeing the prompt) rather than hard-failing the way
execout() did. Worth a follow-up, not blocking.
Verified end-to-end against a real bash SSH connection (temporary local
key-based auth, removed after testing): login, command execution, and
the original csh path and local "system" path all confirmed still
working with no regressions.1 parent 1471eb3 commit 6e26b3c
2 files changed
Lines changed: 35 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2737 | 2737 | | |
2738 | 2738 | | |
2739 | 2739 | | |
2740 | | - | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
2741 | 2747 | | |
2742 | 2748 | | |
2743 | 2749 | | |
| |||
2806 | 2812 | | |
2807 | 2813 | | |
2808 | 2814 | | |
2809 | | - | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
2810 | 2823 | | |
2811 | 2824 | | |
2812 | | - | |
2813 | | - | |
| 2825 | + | |
| 2826 | + | |
2814 | 2827 | | |
2815 | | - | |
| 2828 | + | |
2816 | 2829 | | |
2817 | 2830 | | |
2818 | 2831 | | |
| |||
4094 | 4107 | | |
4095 | 4108 | | |
4096 | 4109 | | |
4097 | | - | |
| 4110 | + | |
| 4111 | + | |
4098 | 4112 | | |
4099 | 4113 | | |
4100 | 4114 | | |
| |||
4270 | 4284 | | |
4271 | 4285 | | |
4272 | 4286 | | |
4273 | | - | |
| 4287 | + | |
| 4288 | + | |
4274 | 4289 | | |
4275 | 4290 | | |
4276 | 4291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
296 | 308 | | |
297 | 309 | | |
298 | 310 | | |
| |||
0 commit comments