set cwd rarher than changing current process directory
This is not actually used in git-annex though.
This commit is contained in:
parent
6eadcab5bf
commit
4de3351c5c
1 changed files with 1 additions and 2 deletions
|
@ -52,14 +52,13 @@ daemonize cmd params openlogfd pidfile changedirectory a = do
|
||||||
nullfd <- openFd "/dev/null" ReadOnly Nothing defaultFileFlags
|
nullfd <- openFd "/dev/null" ReadOnly Nothing defaultFileFlags
|
||||||
redir nullfd stdInput
|
redir nullfd stdInput
|
||||||
redirLog =<< openlogfd
|
redirLog =<< openlogfd
|
||||||
when changedirectory $
|
|
||||||
setCurrentDirectory "/"
|
|
||||||
environ <- getEnvironment
|
environ <- getEnvironment
|
||||||
_ <- createProcess $
|
_ <- createProcess $
|
||||||
(proc cmd (toCommand params))
|
(proc cmd (toCommand params))
|
||||||
{ env = Just (addEntry envvar cmd environ)
|
{ env = Just (addEntry envvar cmd environ)
|
||||||
, create_group = True
|
, create_group = True
|
||||||
, new_session = True
|
, new_session = True
|
||||||
|
, cwd = if changedirectory then Just "/" else Nothing
|
||||||
}
|
}
|
||||||
return ()
|
return ()
|
||||||
where
|
where
|
||||||
|
|
Loading…
Reference in a new issue