[Pkg-ganeti-devel] [ganeti] 124/165: Merge branch 'stable-2.14' into stable-2.15
Apollon Oikonomopoulos
apoikos at moszumanska.debian.org
Tue Aug 11 13:53:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
apoikos pushed a commit to branch master
in repository ganeti.
commit da7e9a94c09e638def0a7d61fd9b3846ed055a8a
Merge: ff3f66b 32230f0
Author: Hrvoje Ribicic <riba at google.com>
Date: Wed May 13 14:15:20 2015 +0000
Merge branch 'stable-2.14' into stable-2.15
* stable-2.14
Fix mismerge by correcting test import
* stable-2.13
(no changes)
* stable-2.12
Expand orphan volume test
Restrict Ganeti's orphan volume checks to the single VG
Modify UDS server startup to set permissions for sockets
Add wheezy chroot files to gitignore file
Makefile.am: Don't use -dynamic-too for .hpc_o files
Makefile.am: Don't use dots in -osuf
Fix compiler invocation for GHC >= 7.8
Makefile.am: Fix wrong -dep-suffix for GHC 7.8
Only upgrade configs not upgraded
Only unlock config if we did lock it
Mention preferred DRBD module settings when using Xen
Avoid assertIn
Test presence of public and private parameters
Put private parameters into the environment
Always close pipe on job forking
Clean up pipes early on failed forks
Signed-off-by: Hrvoje Ribicic <riba at google.com>
Reviewed-by: Klaus Aehlig <aehlig at google.com>
.gitignore | 2 ++
doc/install.rst | 6 +++++-
lib/backend.py | 5 +++--
lib/cmdlib/cluster/verify.py | 11 +++++++++--
lib/config/__init__.py | 5 +----
src/Ganeti/JQueue.hs | 5 +++--
src/Ganeti/Luxi.hs | 11 +++++++++--
src/Ganeti/Metad/ConfigServer.hs | 16 ++++++++++++++--
src/Ganeti/Query/Exec.hs | 8 ++++++--
src/Ganeti/UDSServer.hs | 9 +++++----
src/Ganeti/Utils.hs | 20 +++++++++++++-------
src/Ganeti/WConfd/Server.hs | 15 +++++++++++++--
test/py/cmdlib/cluster_unittest.py | 14 +++++++++++---
test/py/ganeti.backend_unittest.py | 35 +++++++++++++++++++++++++++++++++++
14 files changed, 129 insertions(+), 33 deletions(-)
diff --cc src/Ganeti/Metad/ConfigServer.hs
index ad8e461,62ea43c..ad32e65
--- a/src/Ganeti/Metad/ConfigServer.hs
+++ b/src/Ganeti/Metad/ConfigServer.hs
@@@ -39,28 -42,74 +39,40 @@@ import Control.Monad.Reade
import Ganeti.Path as Path
import Ganeti.Daemon (DaemonOptions, cleanupSocket, describeError)
- import Ganeti.Runtime (GanetiDaemon(..))
-import qualified Ganeti.Logging as Logging
+ import Ganeti.Runtime (GanetiDaemon(..), GanetiGroup(..), MiscGroup(..))
-import Ganeti.UDSServer (Client, ConnectConfig(..), Server, ServerConfig(..))
+import Ganeti.THH.RPC
+import Ganeti.UDSServer (ConnectConfig(..), ServerConfig(..))
import qualified Ganeti.UDSServer as UDSServer
+ import Ganeti.Utils (FilePermissions(..))
-import Ganeti.Metad.Config as Config
-import Ganeti.Metad.Types (InstanceParams)
+import Ganeti.Metad.ConfigCore
--- | Update the configuration with the received instance parameters.
-updateConfig :: MVar InstanceParams -> String -> IO ()
-updateConfig config str =
- case decode str of
- Error err ->
- Logging.logDebug $ show err
- Ok x ->
- case Config.getInstanceParams x of
- Error err ->
- Logging.logError $ "Could not get instance parameters: " ++ err
- Ok (name, instanceParams) -> do
- cfg <- takeMVar config
- let cfg' = mergeConfig cfg instanceParams
- putMVar config cfg'
- Logging.logInfo $
- "Updated instance " ++ show name ++ " configuration"
- Logging.logDebug $ "Instance configuration: " ++ show cfg'
+-- * The handler that converts RPCs to calls to the above functions
--- | Reads messages from clients and update the configuration
--- according to these messages.
-acceptConfig :: MVar InstanceParams -> Client -> IO ()
-acceptConfig config client =
- do res <- try $ UDSServer.recvMsg client
- case res of
- Left err -> do
- unless (isEOFError err) .
- Logging.logDebug $ show err
- return ()
- Right str -> do
- Logging.logDebug $ "Received: " ++ str
- updateConfig config str
+handler :: RpcServer MetadMonadInt
+handler = $( mkRpcM exportedFunctions )
--- | Loop that accepts clients and dispatches them to an isolated
--- thread that will handle the client's requests.
-acceptClients :: MVar InstanceParams -> Server -> IO ()
-acceptClients config server =
- do client <- UDSServer.acceptClient server
- _ <- forkIO $ acceptConfig config client
- acceptClients config server
+-- * The main server code
-start :: DaemonOptions -> MVar InstanceParams -> IO ()
+start :: DaemonOptions -> MetadHandle -> IO ()
start _ config = do
socket_path <- Path.defaultMetadSocket
cleanupSocket socket_path
server <- describeError "binding to the socket" Nothing (Just socket_path)
$ UDSServer.connectServer metadConfig True socket_path
finally
- (acceptClients config server)
+ (forever $ runMetadMonadInt (UDSServer.listener handler server) config)
(UDSServer.closeServer server)
where
- metadConfig = ServerConfig GanetiMetad $ ConnectConfig 60 60
+ metadConfig =
+ ServerConfig
+ -- The permission 0600 is completely acceptable because only the node
+ -- daemon talks to the metadata daemon, and the node daemon runs as
+ -- root.
+ FilePermissions { fpOwner = Just GanetiMetad
+ , fpGroup = Just $ ExtraGroup DaemonsGroup
+ , fpPermissions = 0o0600
+ }
+ ConnectConfig { recvTmo = 60
+ , sendTmo = 60
+ }
diff --cc src/Ganeti/Utils.hs
index c2d1322,c6ddb0d..7ec9f84
--- a/src/Ganeti/Utils.hs
+++ b/src/Ganeti/Utils.hs
@@@ -131,9 -130,7 +131,8 @@@ import System.I
import System.Exit
import System.Posix.Files
import System.Posix.IO
- import System.Posix.User
-import System.Time
+import System.Time (ClockTime(..), getClockTime, TimeDiff(..))
+import qualified System.Time as STime
-- * Debug functions
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git
More information about the Pkg-ganeti-devel
mailing list