summaryrefslogtreecommitdiff
path: root/modules/ssh/shell.scm
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2016-12-18 10:57:31 +0300
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2016-12-18 10:57:31 +0300
commit754231412ee4b81b893dfb30ad43bda4eeb748bd (patch)
tree0c126091d5c37877e9a6ee0fb4007c5bd59b3c12 /modules/ssh/shell.scm
parentshell.scm: Add missing (ice-9 receive) module (diff)
downloadguile-ssh-754231412ee4b81b893dfb30ad43bda4eeb748bd.tar.gz
shell.scm (pkill): New procedure
* modules/ssh/shell.scm (pkill): New procedure * modules/ssh/dist/node.scm (node-stop-server): Use it.
Diffstat (limited to 'modules/ssh/shell.scm')
-rw-r--r--modules/ssh/shell.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/ssh/shell.scm b/modules/ssh/shell.scm
index 6e10bb9..406230f 100644
--- a/modules/ssh/shell.scm
+++ b/modules/ssh/shell.scm
@@ -42,7 +42,7 @@
#:use-module (ice-9 receive)
#:use-module (ssh channel)
#:use-module (ssh popen)
- #:export (rexec which pgrep fallback-pgrep command-available?))
+ #:export (rexec which pgrep pkill fallback-pgrep command-available?))
;;;
@@ -84,6 +84,11 @@ Return two values: a check result and a return code."
(if full? "--full" "")
pattern)))
+(define* (pkill session pattern #:key (full? #f))
+ (rexec session (format #f "pkill ~a '~a'"
+ (if full? "--full" "")
+ pattern)))
+
(define (fallback-pgrep session pattern)
"Guile-SSH implementation of 'pgrep' that uses pure bash and '/proc'
filesystem. Check if a process with a PATTERN cmdline is available on a NODE.