diff options
| author | Artyom V. Poptsov <poptsov.artyom@gmail.com> | 2017-01-04 11:00:27 +0300 |
|---|---|---|
| committer | Artyom V. Poptsov <poptsov.artyom@gmail.com> | 2017-01-04 11:00:27 +0300 |
| commit | b2dfb81256da03b355744dfc43bd05da0914af23 (patch) | |
| tree | c072bf4500b377f3032c9a758f6a6540275a70a8 /modules/ssh/dist | |
| parent | tests/shell.scm ("pgrep"): New TC (diff) | |
| download | guile-ssh-b2dfb81256da03b355744dfc43bd05da0914af23.tar.gz | |
node.scm (issue-procps-warning): New procedure
* modules/ssh/dist/node.scm (issue-procps-warning): New procedure.
(node-server-running?, node-stop-server): Use it.
Diffstat (limited to 'modules/ssh/dist')
| -rw-r--r-- | modules/ssh/dist/node.scm | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/modules/ssh/dist/node.scm b/modules/ssh/dist/node.scm index e4f2430..02fbce3 100644 --- a/modules/ssh/dist/node.scm +++ b/modules/ssh/dist/node.scm @@ -264,6 +264,16 @@ result, a number of the evaluation, a module name and a language name. Throw "Check if procps is available on a NODE." (command-available? (node-session node) "pgrep")) +(define (issue-procps-warning function node missing-procps-tool) + "Issue procps warning due to a MISSING-PROCPS-TOOL on a NODE to the libssh +log." + (format-log 'rare + function + (string-append + "WARNING: '~a' from procps is not available on the node" + " ~a; falling back to the Guile-SSH '~a' implementation") + missing-procps-tool node missing-procps-tool)) + (define (node-server-running? node) "Check if a RREPL is running on a NODE, return #t if it is running and @@ -279,12 +289,7 @@ listens on an expected port, return #f otherwise." (let* ((pgrep? (procps-available? node)) (pgrep (if pgrep? pgrep fallback-pgrep))) (unless pgrep? - (format-log 'rare - "node-server-running?" - (string-append - "WARNING: 'pgrep' from procps is not available on the node" - " ~a; falling back to the Guile-SSH pgrep implementation") - node)) + (issue-procps-warning "node-server-running?" node "pgrep")) (receive (result rc) (pgrep (node-session node) (format #f "guile --listen=~a" @@ -317,12 +322,7 @@ listens on an expected port, return #f otherwise." (let* ((pkill? (procps-available? node)) (pkill (if pkill? pkill fallback-pkill))) (unless pkill? - (format-log 'rare - "node-server-running?" - (string-append - "WARNING: 'pkill' from procps is not available on the node" - " ~a; falling back to the Guile-SSH pkill implementation") - node)) + (issue-procps-warning "node-stop-server" node "pkill")) (pkill (node-session node) (format #f "guile --listen=~a" (node-repl-port node)) #:full? #t) |
