X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/7946c25d27d94529afd084df4530ee4d37be732d..638e0a6fe04e5973e0bb8ffbe444944d712dcf9b:/htools/Ganeti/Runtime.hs diff --git a/htools/Ganeti/Runtime.hs b/htools/Ganeti/Runtime.hs index b6371d3..2ebef2e 100644 --- a/htools/Ganeti/Runtime.hs +++ b/htools/Ganeti/Runtime.hs @@ -49,6 +49,7 @@ import System.Posix.User import Text.Printf import qualified Ganeti.Constants as C +import qualified Ganeti.Path as Path import Ganeti.BasicTypes data GanetiDaemon = GanetiMasterd @@ -91,13 +92,16 @@ daemonGroup (ExtraGroup DaemonsGroup) = C.daemonsGroup daemonGroup (ExtraGroup AdminGroup) = C.adminGroup -- | Returns the log file for a daemon. -daemonLogFile :: GanetiDaemon -> FilePath -daemonLogFile GanetiConfd = C.daemonsLogfilesGanetiConfd -daemonLogFile _ = error "Unimplemented" +daemonLogFile :: GanetiDaemon -> IO FilePath +daemonLogFile daemon = do + logDir <- Path.logDir + return $ logDir daemonName daemon <.> "log" -- | Returns the pid file name for a daemon. -daemonPidFile :: GanetiDaemon -> FilePath -daemonPidFile daemon = C.runGanetiDir daemonName daemon <.> "pid" +daemonPidFile :: GanetiDaemon -> IO FilePath +daemonPidFile daemon = do + runDir <- Path.runDir + return $ runDir daemonName daemon <.> "pid" -- | All groups list. A bit hacking, as we can't enforce it's complete -- at compile time.