Commit acc1eb23 authored by Jose A. Lopes's avatar Jose A. Lopes
Browse files

Add metadata daemon server entry point



... which starts the configuration and web servers.
Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent bf3a5cc0
......@@ -774,6 +774,7 @@ HS_LIB_SRCS = \
src/Ganeti/Logging/Lifted.hs \
src/Ganeti/Luxi.hs \
src/Ganeti/Metad/ConfigServer.hs \
src/Ganeti/Metad/Server.hs \
src/Ganeti/Metad/Types.hs \
src/Ganeti/Metad/WebServer.hs \
src/Ganeti/Monitoring/Server.hs \
......
{-| Metadata daemon server, which controls the configuration and web servers.
-}
{-
Copyright (C) 2014 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
-}
module Ganeti.Metad.Server (start) where
import Control.Concurrent
import qualified Data.Map (empty)
import Ganeti.Daemon (DaemonOptions)
import qualified Ganeti.Metad.ConfigServer as ConfigServer
import qualified Ganeti.Metad.WebServer as WebServer
start :: DaemonOptions -> IO ()
start opts =
do config <- newMVar Data.Map.empty
_ <- forkIO $ WebServer.start opts config
ConfigServer.start opts config
......@@ -28,7 +28,7 @@ module Main (main) where
import qualified Ganeti.Constants as Constants
import Ganeti.Daemon (OptType)
import qualified Ganeti.Daemon as Daemon
import qualified Ganeti.Metad.WebServer as WebServer
import qualified Ganeti.Metad.Server as Server
import qualified Ganeti.Runtime as Runtime
options :: [OptType]
......@@ -45,4 +45,4 @@ main =
Daemon.genericMain Runtime.GanetiMetad options
(\_ -> return . Right $ ())
(\_ _ -> return ())
(\opts _ _ -> WebServer.start opts)
(\opts _ _ -> Server.start opts)
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