Skip to content

B #7717: Fix sshwrap to prevent ssh from consuming following shell input#7718

Open
tomatomov wants to merge 1 commit into
OpenNebula:masterfrom
tomatomov:bugfix/sshwrap-rbd-snap-cleanup
Open

B #7717: Fix sshwrap to prevent ssh from consuming following shell input#7718
tomatomov wants to merge 1 commit into
OpenNebula:masterfrom
tomatomov:bugfix/sshwrap-rbd-snap-cleanup

Conversation

@tomatomov

@tomatomov tomatomov commented May 28, 2026

Copy link
Copy Markdown

Description

Fixes the sshwrap helper so that ssh does not consume input intended for subsequent commands in the calling shell (e.g., the while read loops used during RBD snapshot cleanup). This avoids truncated/skipped iterations when cleaning up snapshots over SSH.

Closes #7717

Changes

  • Pass -n (or redirect stdin from /dev/null) in sshwrap so ssh does not read from the parent shell's stdin.

Testing

  • Verified RBD snapshot cleanup loops process all entries when invoked via sshwrap.

Branches to which this PR applies

  • master
  • one-7.4
  • one-7.2

  • Check this if this PR should not be squashed

TransferManager::Shell.sshwrap currently invokes remote commands using ssh '#{host}' ....

In some environments this causes ssh to read from stdin and consume the remaining commands from the generated local shell script. As a result, commands following the wrapped SSH call may be interpreted as input to ssh instead of being executed by the local shell. This can break snapshot cleanup flows, for example RBD snapshot deletion, where subsequent commands are skipped or not processed as expected.

Adding -n prevents ssh from reading stdin by redirecting it from /dev/null. This makes sshwrap safer for non-interactive execution and avoids relying on distro-specific or host-specific SSH client configuration such as StdinNull.

Signed-off-by: Toma Tomov <toma.tomov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ceph/RBD VM backup leaves temporary RBD snapshots after successful backup

1 participant