summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2017-03-24 15:55:17 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-05-03 21:36:16 +0000
commitb09463dcad15e75405566cd1025f642cbc3eb746 (patch)
tree1c19a0420e099da63287e228b21822c6e5b17719
parentcc3fb5d9a720a9a5b2102683da716004cd938e39 (diff)
downloadphosphor-state-manager-b09463dcad15e75405566cd1025f642cbc3eb746.tar.gz
phosphor-state-manager-b09463dcad15e75405566cd1025f642cbc3eb746.zip
Create initial skeleton of host check code
This sequence of commits will be the application that runs after a BMC reset when it's detected that pgood is on. This applications job is to check whether the host is running, and if it is, to create a specific file in the filesystem that will prevent the host power on targets services from executing. Change-Id: If5d26a443a0d8fd1873df166a6a5d45290eb6401 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
-rw-r--r--Makefile.am9
-rw-r--r--host_check_main.cpp20
2 files changed, 28 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 64b1b82..f15d970 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,8 @@ sbin_PROGRAMS = \
phosphor-host-state-manager \
phosphor-chassis-state-manager \
phosphor-bmc-state-manager \
- phosphor-discover-system-state
+ phosphor-discover-system-state \
+ phosphor-host-check
phosphor_host_state_manager_SOURCES = \
host_state_manager.cpp \
@@ -21,6 +22,9 @@ phosphor_bmc_state_manager_SOURCES = \
phosphor_discover_system_state_SOURCES = \
discover_system_state.cpp
+phosphor_host_check_SOURCES = \
+ host_check_main.cpp
+
generic_cxxflags = $(SYSTEMD_CFLAGS) $(PHOSPHOR_DBUS_INTERFACES_CFLAGS) $(SDBUSPLUS_CFLAGS)
generic_ldflags = $(SYSTEMD_LIBS) $(PHOSPHOR_DBUS_INTERFACES_LIBS) $(SDBUSPLUS_LIBS)
@@ -35,3 +39,6 @@ phosphor_bmc_state_manager_LDFLAGS = $(generic_ldflags)
phosphor_discover_system_state_CXXFLAGS = $(generic_cxxflags)
phosphor_discover_system_state_LDFLAGS = $(generic_ldflags)
+
+phosphor_host_check_CXXFLAGS = $(generic_cxxflags)
+phosphor_host_check_LDFLAGS = $(generic_ldflags)
diff --git a/host_check_main.cpp b/host_check_main.cpp
new file mode 100644
index 0000000..6dab9cb
--- /dev/null
+++ b/host_check_main.cpp
@@ -0,0 +1,20 @@
+#include <cstdlib>
+#include <sdbusplus/bus.hpp>
+#include <phosphor-logging/log.hpp>
+
+using namespace phosphor::logging;
+
+int main(int argc, char *argv[])
+{
+ log<level::INFO>("Check if host is running");
+
+ // Setup Signal Handler
+
+ // Initiate heartbeat command
+
+ // Wait for signal
+
+ // If host running then create file
+
+ return 0;
+}
OpenPOWER on IntegriCloud