Add phosphor-unit-failure-monitor framework
This application is designed to be called from the
OnFailure directive in a systemd unit file. It will
stop or start another unit when the current unit
fails enough times to exceed its restart policy so
it isn't restarted again.
To do this, this application will check the ActiveState
property of the failing unit. When it is 'failed', the
target unit will be started (or stopped).
The failing unit name, the target unit name, and if the
target should be stopped or started are all passed in
on the command line.
Change-Id: I93ecccaf1c091abddb769ddad8f43ecd9902210b
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/configure.ac b/configure.ac
index bd80240..10ea4af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,6 +5,7 @@
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
AM_SILENT_RULES([yes])
+AC_LANG([C++])
# Modify header template
AH_TOP([#pragma once])
@@ -12,6 +13,7 @@
# Checks for programs.
AC_PROG_CC
+AC_PROG_CXX
AM_PROG_AR
AC_PROG_INSTALL
AC_PROG_MAKE_SET
@@ -29,7 +31,8 @@
AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
# Checks for typedefs, structures, and compiler characteristics.
-AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CFLAGS])
+AX_CXX_COMPILE_STDCXX_14([noext])
+AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CFLAGS CXXFLAGS])
# Checks for library functions.
LT_INIT([disable-static shared])
@@ -72,5 +75,5 @@
)
# Create configured output
-AC_CONFIG_FILES([Makefile setup.py])
+AC_CONFIG_FILES([Makefile setup.py fail-monitor/Makefile])
AC_OUTPUT