FIRST_DRBD_PORT = 11000
LAST_DRBD_PORT = 14999
-DAEMONS_LOGFILES = {
- NODED: pathutils.GetLogFilename("node-daemon"),
- CONFD: pathutils.GetLogFilename("conf-daemon"),
- RAPI: pathutils.GetLogFilename("rapi-daemon"),
- MASTERD: pathutils.GetLogFilename("master-daemon"),
+DAEMONS_LOGBASE = {
+ NODED: "node-daemon",
+ CONFD: "conf-daemon",
+ RAPI: "rapi-daemon",
+ MASTERD: "master-daemon",
}
+DAEMONS_LOGFILES = \
+ dict((daemon, pathutils.GetLogFilename(DAEMONS_LOGBASE[daemon]))
+ for daemon in DAEMONS_LOGBASE)
+
DEV_CONSOLE = "/dev/console"
PROC_MOUNTS = "/proc/mounts"
{-
-Copyright (C) 2011, 2012 Google Inc.
+Copyright (C) 2011, 2012, 2013 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
daemonName GanetiRapi = C.rapi
daemonName GanetiConfd = C.confd
+-- | Returns the log file base for a daemon.
+daemonLogBase :: GanetiDaemon -> String
+daemonLogBase GanetiMasterd = C.daemonsLogbaseGanetiMasterd
+daemonLogBase GanetiNoded = C.daemonsLogbaseGanetiNoded
+daemonLogBase GanetiRapi = C.daemonsLogbaseGanetiRapi
+daemonLogBase GanetiConfd = C.daemonsLogbaseGanetiConfd
+
-- | Returns the configured user name for a daemon.
daemonUser :: GanetiDaemon -> String
daemonUser GanetiMasterd = C.masterdUser
daemonLogFile :: GanetiDaemon -> IO FilePath
daemonLogFile daemon = do
logDir <- Path.logDir
- return $ logDir </> daemonName daemon <.> "log"
+ return $ logDir </> daemonLogBase daemon <.> "log"
-- | Returns the pid file name for a daemon.
daemonPidFile :: GanetiDaemon -> IO FilePath