Skip to content

Switch to TMPDIR before initiating SSH multiplexing workaround to prevent locking the destination filesystem#348

Merged
lildude merged 2 commits into
masterfrom
lildude/workaround-bug-from-tmp
Oct 26, 2017
Merged

Switch to TMPDIR before initiating SSH multiplexing workaround to prevent locking the destination filesystem#348
lildude merged 2 commits into
masterfrom
lildude/workaround-bug-from-tmp

Conversation

@lildude

@lildude lildude commented Oct 26, 2017

Copy link
Copy Markdown
Member

As identified in https://github.com/github/backup-utils/issues/345, if we don't switch to $TMPDIR before working around the OpenSSH bug, we end up holding a file handle open on the backup directory until such time as the master connection timeout has been reached (10mins). This poses a problem if the backup directory is an NFS mount that needs to be umounted when the backup has finished.

Fixes https://github.com/github/backup-utils/issues/345

🎩 tip to @zmedico for the fix.

/cc @github/backup-utils

This prevents SSH multiplexing holding a lock on the backup directory
which may be an NFS mount.
@lildude lildude added the bug label Oct 26, 2017
opts="-o ControlMaster=auto -o ControlPath=\"$controlpath\" -o ControlPersist=10m -o ServerAliveInterval=10 $opts"
# Workaround for https://bugzilla.mindrot.org/show_bug.cgi?id=1988
[ -S $controlpath ] || ssh -f -p $port $opts -o BatchMode=yes "$host" -- /bin/true 1>/dev/null 2>&1 || true
if ! [ -S $controlpath ]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we run the cd in a subshell so the working directory is not changed for the script itself? That side effect might trip up people in the future otherwise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good point.

@lildude lildude merged commit be3397c into master Oct 26, 2017
@lildude lildude deleted the lildude/workaround-bug-from-tmp branch October 26, 2017 11:56
@lildude lildude changed the title Switch to TMPDIR when working around OpenSSH bug Switch to TMPDIR before initiating SSH multiplexing workaround to prevent locking the destination filesystem Nov 9, 2017
@lildude lildude mentioned this pull request Nov 9, 2017
JoeFranks1993 pushed a commit that referenced this pull request Jun 29, 2023
…ackup_0

Allow the caller to handle setting failures
bonsohi pushed a commit that referenced this pull request Jul 4, 2023
…ackup_0

Allow the caller to handle setting failures
dooleydevin pushed a commit that referenced this pull request Jul 14, 2023
…ackup_0

Allow the caller to handle setting failures
dooleydevin pushed a commit that referenced this pull request Jul 21, 2023
…ackup_0

Allow the caller to handle setting failures
dooleydevin pushed a commit that referenced this pull request Jul 21, 2023
dooleydevin pushed a commit that referenced this pull request Jul 21, 2023
…ackup_0

Allow the caller to handle setting failures
@bonsohi bonsohi mentioned this pull request Aug 9, 2023

@Smangele87 Smangele87 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test/test-ghe-restore.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

github-backup-utils 2.11.x exits too quickly when the destination is mounted on nfs

3 participants