[kexec-tools/f18: 4/7] get_ssh_size: use -n to redirect stdin from /dev/null

Dave Young yangrr at fedoraproject.org
Fri Nov 16 06:24:54 UTC 2012


commit 4d9bb7face23e8c5cd0c3e2a7113f8f0226349d3
Author: dyoung at redhat.com <dyoung at redhat.com>
Date:   Mon Nov 12 16:51:04 2012 +0800

    get_ssh_size: use -n to redirect stdin from /dev/null
    
    Resolves: bug 868990
    
    ssh will send local stdin input to remote side, this cause trouble
    when we call ssh in the loop of parsing kdump.conf.
    
    Ie. if we specify both 'ssh' and 'core_collector' option in kdump.conf,
    and put 'core_collector' behind 'ssh', there will be no chance to
    handle 'core_collector' because in get_ssh_size() ssh eat all the later
    input of the while loop.
    
    Fix this by use /dev/null as stdin in get_ssh_size().
    
    Tested in fedora kvm guest.
    
    Signed-off-by: Dave Young <dyoung at redhat.com>
    Suggested-by: Vivek Goyal <vgoyal at redhat.com>
    Acked-by: Vivek Goyal <vgoyal at redhat.com>

 mkdumprd |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/mkdumprd b/mkdumprd
index 6baff38..e89334d 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -101,7 +101,7 @@ to_mount_point() {
 get_ssh_size() {
     local _opt _out _size
     _opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes"
-    _out=$(ssh -q $_opt $1 "df -P $SAVE_PATH")
+    _out=$(ssh -q -n $_opt $1 "df -P $SAVE_PATH")
     if [ $? -ne 0 ]; then
         echo "checking remote ssh server available size failed."
         exit 1


More information about the scm-commits mailing list