summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2016-12-24 22:12:56 +0300
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2016-12-24 22:12:56 +0300
commitbf3a4f711229d6d41a98cb962a035d1b77d100d4 (patch)
tree86d0a1d2c77c7c6ce1838ac7121a3c7abf750750 /modules
parentshell.scm (pkill): New procedure (diff)
downloadguile-ssh-bf3a4f711229d6d41a98cb962a035d1b77d100d4.tar.gz
shell.scm (pgrep, pkill): Use '-f' instead of '--full'
* modules/ssh/shell.scm (pgrep, pkill): Use the short version of '--full' option.
Diffstat (limited to 'modules')
-rw-r--r--modules/ssh/shell.scm11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/ssh/shell.scm b/modules/ssh/shell.scm
index 406230f..dfcbfcb 100644
--- a/modules/ssh/shell.scm
+++ b/modules/ssh/shell.scm
@@ -77,16 +77,23 @@ a check result and a return code."
(rexec session (format #f "which '~a'" program-name)))
+;; We should use short '-f' option for pgrep and pkill instead of the long
+;; version of it ('--full') because the long version was added on september
+;; 2011 (according to the commit log of procps-ng [1]) and some systems may
+;; not support it due to older procps.
+;;
+;; [1] https://gitlab.com/procps-ng/procps/commit/4581ac2240d3c2108c6a65ba2d19599195b512bc
+
(define* (pgrep session pattern #:key (full? #f))
"Check if a process with a PATTERN cmdline is available on a NODE.
Return two values: a check result and a return code."
(rexec session (format #f "pgrep ~a '~a'"
- (if full? "--full" "")
+ (if full? "--f" "")
pattern)))
(define* (pkill session pattern #:key (full? #f))
(rexec session (format #f "pkill ~a '~a'"
- (if full? "--full" "")
+ (if full? "-f" "")
pattern)))
(define (fallback-pgrep session pattern)