ganeti-3.1: Cluster-based virtualization management software
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ganeti.Daemon

Description

Implementation of the generic daemon functionality.

Synopsis

Documentation

data DaemonOptions #

Command line options structure.

Constructors

DaemonOptions 

Fields

type OptType = GenericOptType DaemonOptions #

Abrreviation for the option type.

type CheckFn a = DaemonOptions -> IO (Either ExitCode a) #

Check function type.

type PrepFn a b = DaemonOptions -> a -> IO b #

Prepare function type.

type MainFn a b = DaemonOptions -> a -> b -> IO () #

Main execution function type.

defaultOptions :: DaemonOptions #

Default values for the command line options.

oShowHelp :: StandardOptions a => GenericOptType a #

Option to request help output.

oShowVer :: StandardOptions a => GenericOptType a #

Option to request version information.

oPort :: Int -> OptType #

parseArgs :: String -> [OptType] -> IO (DaemonOptions, [String]) #

Small wrapper over getArgs and parseOpts.

parseAddress #

Arguments

:: DaemonOptions

Command line options

-> Int

Default port for this daemon

-> IO (Result (Family, SockAddr)) 

Based on the options, compute the socket address to use for the daemon.

cleanupSocket :: FilePath -> IO () #

Helper function to ensure a socket doesn't exist. Should only be called once we have locked the pid file successfully.

describeError :: String -> Maybe Handle -> Maybe FilePath -> IO a -> IO a #

Run an I/O action that might throw an I/O error, under a handler that will simply annotate and re-throw the exception.

genericMain #

Arguments

:: GanetiDaemon

The daemon we're running

-> [OptType]

The available options

-> CheckFn a

Check function

-> PrepFn a b

Prepare function

-> MainFn a b

Execution function

-> IO () 

Generic daemon startup.

getFQDN :: IO String #

Return the full qualified host name, honoring the vcluster setup.