add a pid file

Writes pid to a file. Is supposed to take an exclusive lock, but that's not
working, and it's too late for me to understand why.
This commit is contained in:
Joey Hess 2012-06-11 01:20:19 -04:00
parent d5884388b0
commit 0b3e2bed78
3 changed files with 37 additions and 16 deletions

View file

@ -67,7 +67,8 @@ start foreground = notBareRepo $ withStateMVar $ \st -> do
liftIO $ watch st
else do
logfd <- liftIO . openLog =<< fromRepo gitAnnexLogFile
liftIO $ daemonize logfd False $ watch st
pidfile <- fromRepo gitAnnexPidFile
liftIO $ daemonize logfd (Just pidfile) False $ watch st
stop
watch :: MVar Annex.AnnexState -> IO ()