Fix ssh connection caching stop method to work with openssh 6.5p1, which broke the old method.

Old ssh did not check the hostname passed to -O stop, so I had used "any".
But now ssh does check it! I think this happened as part of the client-side
hostname canonicalization changes in 6.5p1, but have not verified that
introduced the problem.

The symptom was that it would try to dns lookup "any", which often caused a
bit of a delay at shutdown. And the old ssh connection kept running, so
it would do it over and over again.

Fixed by using localhost, which hopefully reliably resolves to some address
that ssh will accept.. Also nukeFile the socket after ssh has been asked to
shutdown, just in case.
This commit is contained in:
Joey Hess 2014-03-13 19:35:06 -04:00
parent 8e2997aa69
commit ba02cd8a80
2 changed files with 3 additions and 1 deletions

View file

@ -146,7 +146,7 @@ sshCleanup = go =<< sshCacheDir
withQuietOutput createProcessSuccess $
(proc "ssh" $ toCommand $
[ Params "-O stop"
] ++ params ++ [Param "any"])
] ++ params ++ [Param "localhost"])
{ cwd = Just dir }
liftIO $ nukeFile socketfile
-- Cannot remove the lock file; other processes may

2
debian/changelog vendored
View file

@ -14,6 +14,8 @@ git-annex (5.20140307) UNRELEASED; urgency=medium
the repository's description will now fail when multiple repositories
match, rather than picking a repository at random.
(So will --in=)
* Fix ssh connection caching stop method to work with openssh 6.5p1,
which broke the old method.
-- Joey Hess <joeyh@debian.org> Thu, 06 Mar 2014 16:17:01 -0400