When we're parsing kdump.conf, we read it from stdin in a while loop statement. If we don't use ssh -n within the loop, all rest of the kdump.conf options, which are in stdin, will be eaten by ssh.
Signed-off-by: WANG Chao chaowang@redhat.com --- mkdumprd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index 6de1755..43a41cb 100644 --- a/mkdumprd +++ b/mkdumprd @@ -153,7 +153,7 @@ mkdir_save_path_ssh() { local _opt _dir _opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes" - ssh -q $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null + ssh -qn $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null _ret=$? if [ $_ret -ne 0 ]; then perror_exit "mkdir failed on $DUMP_TARGET:$SAVE_PATH" @@ -165,7 +165,7 @@ mkdir_save_path_ssh() if [ $_ret -ne 0 ]; then perror_exit "Could not create temporary directory on $DUMP_TARGET:$SAVE_PATH. Make sure user has write permission on destination" fi - ssh -q $_opt $1 rmdir $_dir + ssh -qn $_opt $1 rmdir $_dir
return 0 }
On Tue, Dec 24, 2013 at 05:49:22PM +0800, WANG Chao wrote:
When we're parsing kdump.conf, we read it from stdin in a while loop statement. If we don't use ssh -n within the loop, all rest of the kdump.conf options, which are in stdin, will be eaten by ssh.
Signed-off-by: WANG Chao chaowang@redhat.com
Good catch, Ack.
mkdumprd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index 6de1755..43a41cb 100644 --- a/mkdumprd +++ b/mkdumprd @@ -153,7 +153,7 @@ mkdir_save_path_ssh() { local _opt _dir _opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes"
- ssh -q $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null
- ssh -qn $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null _ret=$? if [ $_ret -ne 0 ]; then perror_exit "mkdir failed on $DUMP_TARGET:$SAVE_PATH"
@@ -165,7 +165,7 @@ mkdir_save_path_ssh() if [ $_ret -ne 0 ]; then perror_exit "Could not create temporary directory on $DUMP_TARGET:$SAVE_PATH. Make sure user has write permission on destination" fi
- ssh -q $_opt $1 rmdir $_dir
ssh -qn $_opt $1 rmdir $_dir
return 0
}
1.8.4.2
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 12/24/13 at 05:49pm, WANG Chao wrote:
When we're parsing kdump.conf, we read it from stdin in a while loop statement. If we don't use ssh -n within the loop, all rest of the kdump.conf options, which are in stdin, will be eaten by ssh.
Hi, Vivek
Could you review this patch when you have time?
Thanks WANG Chao
Signed-off-by: WANG Chao chaowang@redhat.com
mkdumprd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index 6de1755..43a41cb 100644 --- a/mkdumprd +++ b/mkdumprd @@ -153,7 +153,7 @@ mkdir_save_path_ssh() { local _opt _dir _opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes"
- ssh -q $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null
- ssh -qn $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null _ret=$? if [ $_ret -ne 0 ]; then perror_exit "mkdir failed on $DUMP_TARGET:$SAVE_PATH"
@@ -165,7 +165,7 @@ mkdir_save_path_ssh() if [ $_ret -ne 0 ]; then perror_exit "Could not create temporary directory on $DUMP_TARGET:$SAVE_PATH. Make sure user has write permission on destination" fi
- ssh -q $_opt $1 rmdir $_dir
ssh -qn $_opt $1 rmdir $_dir
return 0
}
1.8.4.2
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On Tue, Dec 24, 2013 at 05:49:22PM +0800, WANG Chao wrote:
When we're parsing kdump.conf, we read it from stdin in a while loop statement. If we don't use ssh -n within the loop, all rest of the kdump.conf options, which are in stdin, will be eaten by ssh.
Signed-off-by: WANG Chao chaowang@redhat.com
Use of "ssh -n" inside mkdir_save_path_ssh() is little subtle. It is not clear why we are doing it. Can yo u please put a comment above mkdir_save_path_ssh() mentioning that it is called from while loop and it should not read from stdin and that's why we are using ssh -n.
Otherwise patch looks good to me.
Thanks Vivek
mkdumprd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index 6de1755..43a41cb 100644 --- a/mkdumprd +++ b/mkdumprd @@ -153,7 +153,7 @@ mkdir_save_path_ssh() { local _opt _dir _opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes"
- ssh -q $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null
- ssh -qn $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null _ret=$? if [ $_ret -ne 0 ]; then perror_exit "mkdir failed on $DUMP_TARGET:$SAVE_PATH"
@@ -165,7 +165,7 @@ mkdir_save_path_ssh() if [ $_ret -ne 0 ]; then perror_exit "Could not create temporary directory on $DUMP_TARGET:$SAVE_PATH. Make sure user has write permission on destination" fi
- ssh -q $_opt $1 rmdir $_dir
ssh -qn $_opt $1 rmdir $_dir
return 0
}
1.8.4.2
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
When we're parsing kdump.conf, we read it from stdin in a while loop statement. If we don't use ssh -n within the loop, all rest of the kdump.conf options, which are in stdin, will be eaten by ssh.
Signed-off-by: WANG Chao chaowang@redhat.com --- mkdumprd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index 6de1755..bc002bc 100644 --- a/mkdumprd +++ b/mkdumprd @@ -134,6 +134,7 @@ is_readonly_mount() {
#Function: get_ssh_size #$1=dump target +#called from while loop and shouldn't read from stdin, so we're using "ssh -n" get_ssh_size() { local _opt _out _size _opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes" @@ -149,11 +150,12 @@ get_ssh_size() { #mkdir if save path does not exist on ssh dump target #$1=ssh dump target #caller should ensure write permission on $DUMP_TARGET:$SAVE_PATH +#called from while loop and shouldn't read from stdin, so we're using "ssh -n" mkdir_save_path_ssh() { local _opt _dir _opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes" - ssh -q $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null + ssh -qn $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null _ret=$? if [ $_ret -ne 0 ]; then perror_exit "mkdir failed on $DUMP_TARGET:$SAVE_PATH" @@ -165,7 +167,7 @@ mkdir_save_path_ssh() if [ $_ret -ne 0 ]; then perror_exit "Could not create temporary directory on $DUMP_TARGET:$SAVE_PATH. Make sure user has write permission on destination" fi - ssh -q $_opt $1 rmdir $_dir + ssh -qn $_opt $1 rmdir $_dir
return 0 }
On Wed, Jan 15, 2014 at 12:46:16PM +0800, WANG Chao wrote:
When we're parsing kdump.conf, we read it from stdin in a while loop statement. If we don't use ssh -n within the loop, all rest of the kdump.conf options, which are in stdin, will be eaten by ssh.
Signed-off-by: WANG Chao chaowang@redhat.com
Acked-by: Vivek Goyal vgoyal@redhat.com
Vivek
mkdumprd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index 6de1755..bc002bc 100644 --- a/mkdumprd +++ b/mkdumprd @@ -134,6 +134,7 @@ is_readonly_mount() {
#Function: get_ssh_size #$1=dump target +#called from while loop and shouldn't read from stdin, so we're using "ssh -n" get_ssh_size() { local _opt _out _size _opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes" @@ -149,11 +150,12 @@ get_ssh_size() { #mkdir if save path does not exist on ssh dump target #$1=ssh dump target #caller should ensure write permission on $DUMP_TARGET:$SAVE_PATH +#called from while loop and shouldn't read from stdin, so we're using "ssh -n" mkdir_save_path_ssh() { local _opt _dir _opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes"
- ssh -q $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null
- ssh -qn $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null _ret=$? if [ $_ret -ne 0 ]; then perror_exit "mkdir failed on $DUMP_TARGET:$SAVE_PATH"
@@ -165,7 +167,7 @@ mkdir_save_path_ssh() if [ $_ret -ne 0 ]; then perror_exit "Could not create temporary directory on $DUMP_TARGET:$SAVE_PATH. Make sure user has write permission on destination" fi
- ssh -q $_opt $1 rmdir $_dir
ssh -qn $_opt $1 rmdir $_dir
return 0
}
1.8.4.2