summaryrefslogtreecommitdiff
path: root/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.sh
diff options
context:
space:
mode:
authorJason M. Bills <jason.m.bills@linux.intel.com>2021-05-24 22:35:24 +0300
committerJason M. Bills <jason.m.bills@linux.intel.com>2021-05-24 22:35:24 +0300
commit0e0df451ae365f09d5c0c766b253f23de26901f2 (patch)
treedb4d7d3ce85e02ee01ad58a86ede02ac876aae77 /meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.sh
parente370fd750e2821620ec427f26f8efab0069824ff (diff)
parent7e10dee74964afa47859704886128dd256acf854 (diff)
downloadopenbmc-0e0df451ae365f09d5c0c766b253f23de26901f2.tar.xz
Merge tag '0.52' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into update
Diffstat (limited to 'meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.sh')
-rw-r--r--meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.sh b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.sh
new file mode 100644
index 000000000..1bff18d08
--- /dev/null
+++ b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+state="xyz.openbmc_project.State.Chassis.PowerState.Off"
+
+dbus-monitor --system type='signal',interface='org.freedesktop.DBus.Properties',\
+member='PropertiesChanged',arg0namespace='xyz.openbmc_project.State.Chassis' | \
+while read -r line; do
+ grep -q member <<< $line && continue
+ if grep -q $state <<< $line; then
+ echo "Setting failsafe assuming host is off" >&2
+ systemctl start --no-block gbs-host-s5-set-failsafe
+ fi
+done