Commit f511082f authored by Michele Tartara's avatar Michele Tartara
Browse files

Add Mond to the list of possible daemons



Also, add its logfiles and extra log files.
Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent a8828704
......@@ -157,12 +157,14 @@ NODED = "ganeti-noded"
CONFD = "ganeti-confd"
RAPI = "ganeti-rapi"
MASTERD = "ganeti-masterd"
MOND = "ganeti-mond"
DAEMONS = compat.UniqueFrozenset([
NODED,
CONFD,
RAPI,
MASTERD,
MOND,
])
DAEMONS_PORTS = {
......@@ -172,6 +174,7 @@ DAEMONS_PORTS = {
RAPI: ("tcp", 5080),
SSH: ("tcp", 22),
}
DEFAULT_NODED_PORT = DAEMONS_PORTS[NODED][1]
DEFAULT_CONFD_PORT = DAEMONS_PORTS[CONFD][1]
DEFAULT_RAPI_PORT = DAEMONS_PORTS[RAPI][1]
......@@ -184,6 +187,7 @@ DAEMONS_LOGBASE = {
CONFD: "conf-daemon",
RAPI: "rapi-daemon",
MASTERD: "master-daemon",
MOND: "monitoring-daemon",
}
DAEMONS_LOGFILES = \
......@@ -191,6 +195,8 @@ DAEMONS_LOGFILES = \
for daemon in DAEMONS_LOGBASE)
# Some daemons might require more than one logfile.
# Specifically, right now only the Haskell http library "snap", used by the
# monitoring daemon, requires multiple log files.
# These are the only valid reasons for having an extra logfile
EXTRA_LOGREASON_ACCESS = "access"
......@@ -202,7 +208,12 @@ VALID_EXTRA_LOGREASONS = compat.UniqueFrozenset([
])
# These are the extra logfiles, grouped by daemon
DAEMONS_EXTRA_LOGBASE = {}
DAEMONS_EXTRA_LOGBASE = {
MOND: {
EXTRA_LOGREASON_ACCESS: "monitoring-daemon-access",
EXTRA_LOGREASON_ERROR: "monitoring-daemon-error",
}
}
DAEMONS_EXTRA_LOGFILES = \
dict((daemon, dict((extra,
......
......@@ -56,6 +56,7 @@ data GanetiDaemon = GanetiMasterd
| GanetiNoded
| GanetiRapi
| GanetiConfd
| GanetiMond
deriving (Show, Enum, Bounded, Eq, Ord)
data MiscGroup = DaemonsGroup
......@@ -74,6 +75,7 @@ daemonName GanetiMasterd = C.masterd
daemonName GanetiNoded = C.noded
daemonName GanetiRapi = C.rapi
daemonName GanetiConfd = C.confd
daemonName GanetiMond = C.mond
-- | Returns the log file base for a daemon.
daemonLogBase :: GanetiDaemon -> String
......@@ -81,6 +83,7 @@ daemonLogBase GanetiMasterd = C.daemonsLogbaseGanetiMasterd
daemonLogBase GanetiNoded = C.daemonsLogbaseGanetiNoded
daemonLogBase GanetiRapi = C.daemonsLogbaseGanetiRapi
daemonLogBase GanetiConfd = C.daemonsLogbaseGanetiConfd
daemonLogBase GanetiMond = C.daemonsLogbaseGanetiMond
-- | Returns the configured user name for a daemon.
daemonUser :: GanetiDaemon -> String
......@@ -88,6 +91,7 @@ daemonUser GanetiMasterd = C.masterdUser
daemonUser GanetiNoded = C.nodedUser
daemonUser GanetiRapi = C.rapiUser
daemonUser GanetiConfd = C.confdUser
daemonUser GanetiMond = C.mondUser
-- | Returns the configured group for a daemon.
daemonGroup :: GanetiGroup -> String
......@@ -95,6 +99,7 @@ daemonGroup (DaemonGroup GanetiMasterd) = C.masterdGroup
daemonGroup (DaemonGroup GanetiNoded) = C.nodedGroup
daemonGroup (DaemonGroup GanetiRapi) = C.rapiGroup
daemonGroup (DaemonGroup GanetiConfd) = C.confdGroup
daemonGroup (DaemonGroup GanetiMond) = C.mondGroup
daemonGroup (ExtraGroup DaemonsGroup) = C.daemonsGroup
daemonGroup (ExtraGroup AdminGroup) = C.adminGroup
......
......@@ -83,13 +83,16 @@ case_UsersGroups = do
\ constants.NODED_USER,\n\
\ constants.RAPI_USER,\n\
\ constants.CONFD_USER,\n\
\ constants.MOND_USER,\n\
\ ]\n\
\groups = [constants.MASTERD_GROUP,\n\
\ constants.NODED_GROUP,\n\
\ constants.RAPI_GROUP,\n\
\ constants.CONFD_GROUP,\n\
\ constants.MOND_GROUP,\n\
\ constants.DAEMONS_GROUP,\n\
\ constants.ADMIN_GROUP]\n\
\ constants.ADMIN_GROUP,\n\
\ ]\n\
\encoded = (users, groups)\n\
\print serializer.Dump(encoded)" ""
>>= checkPythonResult
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment