|
| 1 | +--- |
| 2 | +type: pitfall |
| 3 | +title: "A remote view must ride ECCE's own login, not start an ssh of its own" |
| 4 | +area: services |
| 5 | +section: "Pitfalls" |
| 6 | +paths: ["src/comm/commtools/TailSource.C", "src/wxgui/comm/WxTailWindow.C", "src/comm/commtools/EcceShell.C", "src/comm/rcommand/SshTransport.C", "src/apps/organizer/CalcMgr.C"] |
| 7 | +issues: [204] |
| 8 | +--- |
| 9 | +**Anything that shows a remote file runs over the RCommand connection that |
| 10 | +logged in, never through a terminal's own `ssh`.** Run Mgmt > Tail used to |
| 11 | +log in through RCommand (AuthCache, then passdialog) only to check the file, |
| 12 | +then start `xterm -e ssh -t host 'tail -f ...'`: an OpenSSH client that |
| 13 | +knows nothing of the libssh session, so a password-only cluster asked twice |
| 14 | +and a two-factor one wanted a second code. |
| 15 | + |
| 16 | +Tail now opens `WxTailWindow`, fed by `TailSource`: one `RCommand`, a file |
| 17 | +check, then `startStream(script, true)`, which on libssh is |
| 18 | +`SshTransport::openStreamOnLogin` -- an exec channel on the session that |
| 19 | +just authenticated (the ordinary `openStream`, used by the job monitor, |
| 20 | +opens a session of its own and logs in again). Until `closeStream()` that |
| 21 | +session belongs to the stream's pump thread, and `run()`/SFTP on it fail |
| 22 | +with "busy". On OpenSSH (a shared connection) and locally (DirectTransport) |
| 23 | +the plain stream already shares the login. The script ends `tail` when its |
| 24 | +stdin closes (`cat >/dev/null; kill`), so a closed window or a dropped link |
| 25 | +leaves nothing running on the login node. |
| 26 | + |
| 27 | +The terminal route remains behind the `TailInTerminal` preference |
| 28 | +(EcceGlobal) or `ECCE_TAIL_TERMINAL=1`; it passes ECCE's ControlPath |
| 29 | +(`OpenSshTransport::controlArgs`) to the terminal's ssh, so a connection |
| 30 | +ECCE shares is reused, but over libssh it still logs in again. |
| 31 | +Tests: `transport_tail`, `transport_tail_window` (ctest), |
| 32 | +`tests/transport/sshd/tail_test.sh` (one login per Tail, counted). |
0 commit comments