Commit 46d5c003 authored by Petr Pudlak's avatar Petr Pudlak
Browse files

Make the metadata daemon optional during configuration



In particular, skip its compilation, if the required packages aren't
present.
Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent f67aabd9
...@@ -326,6 +326,9 @@ endif ...@@ -326,6 +326,9 @@ endif
if ENABLE_MOND if ENABLE_MOND
HS_GENERATED_FILES += src/ganeti-mond HS_GENERATED_FILES += src/ganeti-mond
endif endif
if ENABLE_METADATA
HS_GENERATED_FILES += src/ganeti-metad
endif
built_base_sources = \ built_base_sources = \
stamp-directories \ stamp-directories \
...@@ -669,7 +672,6 @@ endif ...@@ -669,7 +672,6 @@ endif
# Haskell programs to be compiled by "make really-all" # Haskell programs to be compiled by "make really-all"
HS_COMPILE_PROGS = \ HS_COMPILE_PROGS = \
src/ganeti-kvmd \ src/ganeti-kvmd \
src/ganeti-metad \
src/ganeti-wconfd \ src/ganeti-wconfd \
src/hluxid \ src/hluxid \
src/hs2py \ src/hs2py \
...@@ -680,6 +682,9 @@ endif ...@@ -680,6 +682,9 @@ endif
if ENABLE_MOND if ENABLE_MOND
HS_COMPILE_PROGS += src/ganeti-mond HS_COMPILE_PROGS += src/ganeti-mond
endif endif
if ENABLE_METADATA
HS_COMPILE_PROGS += src/ganeti-metad
endif
# All Haskell non-test programs to be compiled but not automatically installed # All Haskell non-test programs to be compiled but not automatically installed
HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS) HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS)
...@@ -1227,7 +1232,6 @@ nodist_sbin_SCRIPTS = \ ...@@ -1227,7 +1232,6 @@ nodist_sbin_SCRIPTS = \
daemons/ganeti-cleaner \ daemons/ganeti-cleaner \
src/ganeti-kvmd \ src/ganeti-kvmd \
src/ganeti-luxid \ src/ganeti-luxid \
src/ganeti-metad \
src/ganeti-wconfd src/ganeti-wconfd
src/ganeti-luxid: src/hluxid src/ganeti-luxid: src/hluxid
...@@ -1249,6 +1253,10 @@ if ENABLE_MOND ...@@ -1249,6 +1253,10 @@ if ENABLE_MOND
nodist_sbin_SCRIPTS += src/ganeti-mond nodist_sbin_SCRIPTS += src/ganeti-mond
endif endif
if ENABLE_METADATA
nodist_sbin_SCRIPTS += src/ganeti-metad
endif
python_scripts = \ python_scripts = \
tools/cfgshell \ tools/cfgshell \
tools/cfgupgrade \ tools/cfgupgrade \
...@@ -2070,6 +2078,7 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in $(PRINT_PY_CONSTANTS) \ ...@@ -2070,6 +2078,7 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in $(PRINT_PY_CONSTANTS) \
-DENABLE_CONFD="$(ENABLE_CONFD)" \ -DENABLE_CONFD="$(ENABLE_CONFD)" \
-DXEN_CMD="$(XEN_CMD)" \ -DXEN_CMD="$(XEN_CMD)" \
-DENABLE_RESTRICTED_COMMANDS="$(ENABLE_RESTRICTED_COMMANDS)" \ -DENABLE_RESTRICTED_COMMANDS="$(ENABLE_RESTRICTED_COMMANDS)" \
-DENABLE_METADATA="$(ENABLE_METADATA)" \
-DENABLE_MOND="$(ENABLE_MOND)" \ -DENABLE_MOND="$(ENABLE_MOND)" \
-DHAS_GNU_LN="$(HAS_GNU_LN)" \ -DHAS_GNU_LN="$(HAS_GNU_LN)" \
-DMAN_PAGES="$$(for i in $(notdir $(man_MANS)); do \ -DMAN_PAGES="$$(for i in $(notdir $(man_MANS)); do \
......
...@@ -586,6 +586,14 @@ AC_ARG_ENABLE([monitoring], ...@@ -586,6 +586,14 @@ AC_ARG_ENABLE([monitoring],
[], [],
[enable_monitoring=check]) [enable_monitoring=check])
# --enable-metadata
ENABLE_METADATA=
AC_ARG_ENABLE([metadata],
[AS_HELP_STRING([--enable-metadata],
[enable the ganeti metadata daemon (default: check)])],
[],
[enable_metadata=check])
# Check for ghc # Check for ghc
AC_ARG_VAR(GHC, [ghc path]) AC_ARG_VAR(GHC, [ghc path])
AC_PATH_PROG(GHC, [ghc], []) AC_PATH_PROG(GHC, [ghc], [])
...@@ -710,6 +718,31 @@ fi ...@@ -710,6 +718,31 @@ fi
AC_SUBST(ENABLE_MOND, $has_monitoring) AC_SUBST(ENABLE_MOND, $has_monitoring)
AM_CONDITIONAL([ENABLE_MOND], [test "$has_monitoring" = True]) AM_CONDITIONAL([ENABLE_MOND], [test "$has_monitoring" = True])
# extra modules for metad functionality; also needed for tests
METAD_PKG=
AC_GHC_PKG_CHECK([snap-server], [],
[NS_NODEV=1; METAD_PKG="$METAD_PKG snap-server"])
has_metad=False
if test "$enable_metadata" != no; then
if test -z "$METAD_PKG"; then
has_metad=True
elif test "$enable_metadata" = check; then
AC_MSG_WARN(m4_normalize([The required extra libraries for metad were
not found ($METAD_PKG), metad disabled]))
else
AC_MSG_FAILURE(m4_normalize([The metadata functionality was requested, but
required libraries were not found:
$METAD_PKG]))
fi
fi
AC_SUBST(HS_REGEX_PCRE)
if test "$has_metad" = True; then
AC_MSG_NOTICE([Enabling metadata usage])
fi
AC_SUBST(ENABLE_METADATA, $has_metad)
AM_CONDITIONAL([ENABLE_METADATA], [test x$has_metad = xTrue])
# development modules # development modules
AC_GHC_PKG_CHECK([QuickCheck-2.*], [], [HS_NODEV=1], t) AC_GHC_PKG_CHECK([QuickCheck-2.*], [], [HS_NODEV=1], t)
AC_GHC_PKG_CHECK([test-framework-0.6*], [], [ AC_GHC_PKG_CHECK([test-framework-0.6*], [], [
......
...@@ -232,6 +232,9 @@ enableRestrictedCommands = ENABLE_RESTRICTED_COMMANDS ...@@ -232,6 +232,9 @@ enableRestrictedCommands = ENABLE_RESTRICTED_COMMANDS
enableMond :: Bool enableMond :: Bool
enableMond = ENABLE_MOND enableMond = ENABLE_MOND
enableMetad :: Bool
enableMetad = ENABLE_METADATA
hasGnuLn :: Bool hasGnuLn :: Bool
hasGnuLn = HAS_GNU_LN hasGnuLn = HAS_GNU_LN
......
...@@ -323,6 +323,9 @@ enableConfd = AutoConf.enableConfd ...@@ -323,6 +323,9 @@ enableConfd = AutoConf.enableConfd
enableMond :: Bool enableMond :: Bool
enableMond = AutoConf.enableMond enableMond = AutoConf.enableMond
enableMetad :: Bool
enableMetad = AutoConf.enableMetad
enableRestrictedCommands :: Bool enableRestrictedCommands :: Bool
enableRestrictedCommands = AutoConf.enableRestrictedCommands enableRestrictedCommands = AutoConf.enableRestrictedCommands
......
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