From c5a116b86500c89070cb6591d96437454d2282c1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 4 Apr 2013 13:14:55 -0400 Subject: init: Probe whether the filesystem supports fifos, and if not, disable ssh connection caching. --- Init.hs | 20 ++++++++++++++++++++ debian/changelog | 2 ++ doc/bugs/ssh_connection_caching_broken_on_NTFS.mdwn | 3 +++ 3 files changed, 25 insertions(+) diff --git a/Init.hs b/Init.hs index 0ada312e7..678bd7301 100644 --- a/Init.hs +++ b/Init.hs @@ -18,6 +18,7 @@ import Utility.TempFile import Utility.Network import qualified Git import qualified Git.LsFiles +import qualified Git.Config import qualified Annex.Branch import Logs.UUID import Annex.Version @@ -44,6 +45,7 @@ initialize mdescription = do prepUUID setVersion defaultVersion checkCrippledFileSystem + checkFifoSupport Annex.Branch.create gitPreCommitHookWrite createInodeSentinalFile @@ -144,3 +146,21 @@ checkCrippledFileSystem = whenM probeCrippledFileSystem $ do void $ liftIO clean setDirect True setVersion directModeVersion + +probeFifoSupport :: Annex Bool +probeFifoSupport = do + tmp <- fromRepo gitAnnexTmpDir + let f = tmp "gaprobe" + liftIO $ do + createDirectoryIfMissing True tmp + nukeFile f + createNamedPipe f ownerReadMode + ms <- tryIO $ getFileStatus f + nukeFile f + return $ either (const False) isNamedPipe ms + +checkFifoSupport :: Annex () +checkFifoSupport = unlessM probeFifoSupport $ do + warning "Detected a filesystem without fifo support." + warning "Disabling ssh connection caching." + setConfig (annexConfig "sshcaching") (Git.Config.boolConfig False) diff --git a/debian/changelog b/debian/changelog index 62c5ac62b..5c52fb736 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,6 +28,8 @@ git-annex (4.20130324) UNRELEASED; urgency=low from git. * Update working tree files fully atomically. * webapp: Improved transfer queue management. + * init: Probe whether the filesystem supports fifos, and if not, + disable ssh connection caching. -- Joey Hess Mon, 25 Mar 2013 10:21:46 -0400 diff --git a/doc/bugs/ssh_connection_caching_broken_on_NTFS.mdwn b/doc/bugs/ssh_connection_caching_broken_on_NTFS.mdwn index bfb221163..fc3168e0f 100644 --- a/doc/bugs/ssh_connection_caching_broken_on_NTFS.mdwn +++ b/doc/bugs/ssh_connection_caching_broken_on_NTFS.mdwn @@ -61,3 +61,6 @@ However ssh connection caching breaks things on NTFS volumes. If I turn off con but it would be nifty if git-annex could detect the filesystem type and do The Right Thing. Thanks for all the work on git-annex -- it's an awesome project! + +> [[done]], `git annex init` now probes for fifo support and disables ssh +> connection caching if it cannot make one. --[[Joey]] -- cgit v1.2.3