run checkCanWatch before redirecting errors to log
This was handled ok in daemon mode, but not in foreground mode.
This commit is contained in:
parent
1c1b8da5a3
commit
5faecdcb1d
1 changed files with 7 additions and 5 deletions
12
Assistant.hs
12
Assistant.hs
|
@ -177,15 +177,17 @@ startDaemon assistant foreground listenhost startbrowser = do
|
||||||
logfd <- liftIO $ openLog logfile
|
logfd <- liftIO $ openLog logfile
|
||||||
if foreground
|
if foreground
|
||||||
then do
|
then do
|
||||||
liftIO $ debugM desc $ "logging to " ++ logfile
|
showStart "." desc
|
||||||
liftIO $ Utility.Daemon.lockPidFile pidfile
|
|
||||||
origout <- liftIO $ catchMaybeIO $
|
origout <- liftIO $ catchMaybeIO $
|
||||||
fdToHandle =<< dup stdOutput
|
fdToHandle =<< dup stdOutput
|
||||||
origerr <- liftIO $ catchMaybeIO $
|
origerr <- liftIO $ catchMaybeIO $
|
||||||
fdToHandle =<< dup stdError
|
fdToHandle =<< dup stdError
|
||||||
liftIO $ Utility.LogFile.redirLog logfd
|
let undaemonize a = do
|
||||||
showStart "." desc
|
debugM desc $ "logging to " ++ logfile
|
||||||
start id $
|
Utility.Daemon.lockPidFile pidfile
|
||||||
|
Utility.LogFile.redirLog logfd
|
||||||
|
a
|
||||||
|
start undaemonize $
|
||||||
case startbrowser of
|
case startbrowser of
|
||||||
Nothing -> Nothing
|
Nothing -> Nothing
|
||||||
Just a -> Just $ a origout origerr
|
Just a -> Just $ a origout origerr
|
||||||
|
|
Loading…
Add table
Reference in a new issue