diff options
| author | Artyom V. Poptsov <poptsov.artyom@gmail.com> | 2018-03-05 05:11:45 +0300 |
|---|---|---|
| committer | Artyom V. Poptsov <poptsov.artyom@gmail.com> | 2018-03-05 05:11:45 +0300 |
| commit | e24401f1ef56b1f3d7ef847c54fb0c2fe9cf3cf8 (patch) | |
| tree | 13fb921319587dad3fdae30a94b69c1a94e8d3ee | |
| parent | auth.scm: Add procedures for interacting w/ an OpenSSH agent (diff) | |
| download | guile-ssh-e24401f1ef56b1f3d7ef847c54fb0c2fe9cf3cf8.tar.gz | |
node.scm (node-run-server): Check return code
* modules/ssh/dist/node.scm (node-run-server): Check return code of the
executed command, throw a 'node-error' on a non-zero code.
* AUTHORS, NEWS, THANKS: Update.
| -rw-r--r-- | AUTHORS | 4 | ||||
| -rw-r--r-- | NEWS | 10 | ||||
| -rw-r--r-- | THANKS | 1 | ||||
| -rw-r--r-- | modules/ssh/dist/node.scm | 15 |
4 files changed, 23 insertions, 7 deletions
@@ -55,4 +55,6 @@ See also files THANKS and ChangeLog. Bug reports, various comments and suggestions. * Mathieu <https://github.com/mothacehe> - Pointed out to bugs in 'rrepl-get-result' from (ssh dist node).
\ No newline at end of file + Pointed out to bugs in 'rrepl-get-result' from (ssh dist node). +* Marius Bakke <mbakke@fastmail.com> + Pointed out to buigs in 'node-run-server' from (ssh dist node).
\ No newline at end of file @@ -7,6 +7,16 @@ Copyright (C) Artyom V. Poptsov <poptsov.artyom@gmail.com> are permitted in any medium without royalty provided the copyright notice and this notice are preserved. +* Unreleased +** Bugfixes +*** 'node-run-server' now checks for errors + When 'node-run-server' fails to start the server it would go down an + infinite loop. The procedure now checks if the RREPL server started + correctly and throws 'node-error' if it's not. + + Reported by Marius Bakke and Ludovic Courtès, in + <https://bugs.gnu.org/30522> + * Changes in version 0.11.2 (2017-06-18) ** Bugfixes *** Always reset the channel and sftp streams when closing ports @@ -13,6 +13,7 @@ through bug reports or patches: * Ludovic Courtès <ludo@gnu.org> * SaffronSnail <https://github.com/SaffronSnail> * Mathieu <https://github.com/mothacehe> +* Marius Bakke <mbakke@fastmail.com> Thank you.
\ No newline at end of file diff --git a/modules/ssh/dist/node.scm b/modules/ssh/dist/node.scm index 09ce794..9ff3750 100644 --- a/modules/ssh/dist/node.scm +++ b/modules/ssh/dist/node.scm @@ -349,13 +349,16 @@ listens on an expected port, return #f otherwise." (guile-up-and-running?)))))))) +(define %guile-listen-command "nohup guile --listen=~a 0<&- &>/dev/null") + (define (node-run-server node) - "Run a RREPL server on a NODE." - (open-remote-input-pipe (node-session node) - (format #f "nohup guile --listen=~a 0<&- &>/dev/null" - (node-repl-port node))) - (while (not (node-server-running? node)) - (usleep 100))) + "Run a RREPL server on a NODE. Throw 'node-error on an error." + (let* ((cmd (format #f %guile-listen-command (node-repl-port node))) + (channel (open-remote-input-pipe (node-session node) cmd))) + (when (not (zero? (channel-get-exit-status channel))) + (node-error "node-run-server: Could not execute command" cmd)) + (while (not (node-server-running? node)) + (usleep 100)))) (define (node-stop-server node) "Stop a RREPL server on a NODE." |
