diff options
author | Joey Hess <joey@kitenet.net> | 2012-06-17 14:02:58 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-06-17 14:21:29 -0400 |
commit | 1863185693f407a35f1b9e92d402e43409966928 (patch) | |
tree | eabb3ecf7fb19e0d4d20146830e8f74444f512fc /Assistant.hs | |
parent | e84b78f40c5ae20031c1d5cdde524081774de656 (diff) |
startup check fixes
Move lsof check, and display a message before daemon startup if on an
unsupported OS.
Diffstat (limited to 'Assistant.hs')
-rw-r--r-- | Assistant.hs | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/Assistant.hs b/Assistant.hs index 54556616d..f5acc2ef8 100644 --- a/Assistant.hs +++ b/Assistant.hs @@ -49,7 +49,6 @@ import Assistant.DaemonStatus import Assistant.Watcher import Assistant.Committer import Assistant.SanityChecker -import qualified Annex import qualified Utility.Daemon import Utility.LogFile @@ -65,12 +64,8 @@ startDaemon foreground pidfile <- fromRepo gitAnnexPidFile go $ Utility.Daemon.daemonize logfd (Just pidfile) False where - go a = ifM (liftIO $ inPath "lsof") - ( go a - , ifM (Annex.getState Annex.force) - (start a, needlsof) - ) - start a = withThreadState $ \st -> do + go a = withThreadState $ \st -> do + checkCanWatch dstatus <- startDaemonStatus liftIO $ a $ do changechan <- newChangeChan @@ -84,12 +79,5 @@ startDaemon foreground _ <- forkIO $ sanityCheckerThread st dstatus changechan watchThread st dstatus changechan - needlsof = error $ unlines - [ "The lsof command is needed for watch mode to be safe, and is not in PATH." - , "To override lsof checks to ensure that files are not open for writing" - , "when added to the annex, you can use --force" - , "Be warned: This can corrupt data in the annex, and make fsck complain." - ] - stopDaemon :: Annex () stopDaemon = liftIO . Utility.Daemon.stopDaemon =<< fromRepo gitAnnexPidFile |