From 4d9bb7face23e8c5cd0c3e2a7113f8f0226349d3 Mon Sep 17 00:00:00 2001 From: "dyoung@redhat.com" Date: Mon, 12 Nov 2012 16:51:04 +0800 Subject: [PATCH] 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 Suggested-by: Vivek Goyal Acked-by: Vivek Goyal --- mkdumprd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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