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

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
if ENABLE_MOND
HS_GENERATED_FILES += src/ganeti-mond
endif
if ENABLE_METADATA
HS_GENERATED_FILES += src/ganeti-metad
endif
built_base_sources = \
stamp-directories \
......@@ -669,7 +672,6 @@ endif
# Haskell programs to be compiled by "make really-all"
HS_COMPILE_PROGS = \
src/ganeti-kvmd \
src/ganeti-metad \
src/ganeti-wconfd \
src/hluxid \
src/hs2py \
......@@ -680,6 +682,9 @@ endif
if ENABLE_MOND
HS_COMPILE_PROGS += src/ganeti-mond
endif
if ENABLE_METADATA
HS_COMPILE_PROGS += src/ganeti-metad
endif
# All Haskell non-test programs to be compiled but not automatically installed
HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS)
......@@ -1227,7 +1232,6 @@ nodist_sbin_SCRIPTS = \
daemons/ganeti-cleaner \
src/ganeti-kvmd \
src/ganeti-luxid \
src/ganeti-metad \
src/ganeti-wconfd
src/ganeti-luxid: src/hluxid
......@@ -1249,6 +1253,10 @@ if ENABLE_MOND
nodist_sbin_SCRIPTS += src/ganeti-mond
endif
if ENABLE_METADATA
nodist_sbin_SCRIPTS += src/ganeti-metad
endif
python_scripts = \
tools/cfgshell \
tools/cfgupgrade \
......@@ -2070,6 +2078,7 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in $(PRINT_PY_CONSTANTS) \
-DENABLE_CONFD="$(ENABLE_CONFD)" \
-DXEN_CMD="$(XEN_CMD)" \
-DENABLE_RESTRICTED_COMMANDS="$(ENABLE_RESTRICTED_COMMANDS)" \
-DENABLE_METADATA="$(ENABLE_METADATA)" \
-DENABLE_MOND="$(ENABLE_MOND)" \
-DHAS_GNU_LN="$(HAS_GNU_LN)" \
-DMAN_PAGES="$$(for i in $(notdir $(man_MANS)); do \
......
......@@ -586,6 +586,14 @@ AC_ARG_ENABLE([monitoring],
[],
[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
AC_ARG_VAR(GHC, [ghc path])
AC_PATH_PROG(GHC, [ghc], [])
......@@ -710,6 +718,31 @@ fi
AC_SUBST(ENABLE_MOND, $has_monitoring)
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
AC_GHC_PKG_CHECK([QuickCheck-2.*], [], [HS_NODEV=1], t)
AC_GHC_PKG_CHECK([test-framework-0.6*], [], [
......
......@@ -232,6 +232,9 @@ enableRestrictedCommands = ENABLE_RESTRICTED_COMMANDS
enableMond :: Bool
enableMond = ENABLE_MOND
enableMetad :: Bool
enableMetad = ENABLE_METADATA
hasGnuLn :: Bool
hasGnuLn = HAS_GNU_LN
......
......@@ -323,6 +323,9 @@ enableConfd = AutoConf.enableConfd
enableMond :: Bool
enableMond = AutoConf.enableMond
enableMetad :: Bool
enableMetad = AutoConf.enableMetad
enableRestrictedCommands :: Bool
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