summaryrefslogtreecommitdiffstats
path: root/meta-phosphor
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2017-03-06 11:06:27 -0600
committerPatrick Williams <patrick@stwcx.xyz>2017-03-15 21:16:14 +0000
commit1e7bfcccd74ab5f3a7f39afac7c178bde7478d1a (patch)
treeb10b143f3e3ec5828bf232d538f6939d4da8221d /meta-phosphor
parentcd0afd1219e5a42f464f173729d4151fc3a70ae8 (diff)
downloadtalos-openbmc-1e7bfcccd74ab5f3a7f39afac7c178bde7478d1a.tar.gz
talos-openbmc-1e7bfcccd74ab5f3a7f39afac7c178bde7478d1a.zip
Service for enabling/disabling host failure reboots
Wraps the auto_reboot host setting in a service so it can be enabled or disabled by starting or stopping the service. Change-Id: Ib3e92f67eb833cd6e31e153b58a63edb6837ae2c Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'meta-phosphor')
-rw-r--r--meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots.bb9
-rw-r--r--meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots/host-failure-reboots.service13
2 files changed, 22 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots.bb b/meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots.bb
new file mode 100644
index 000000000..e0f9b8442
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots.bb
@@ -0,0 +1,9 @@
+SUMMARY = "Enables reboots on host failures"
+DESCRIPTION = "Manages the settings entry that controls reboots \
+on host failures"
+PR = "r1"
+
+inherit obmc-phosphor-systemd
+inherit obmc-phosphor-license
+
+SYSTEMD_SERVICE_${PN} += "host-failure-reboots.service"
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots/host-failure-reboots.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots/host-failure-reboots.service
new file mode 100644
index 000000000..81902ae37
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots/host-failure-reboots.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Enable reboot on host failures
+Wants=mapper-wait@-org-openbmc-settings-host0.service
+After=mapper-wait@-org-openbmc-settings-host0.service
+
+[Service]
+ExecStart = /bin/sh -c "busctl set-property `mapper get-service /org/openbmc/settings/host0` /org/openbmc/settings/host0 org.openbmc.settings.Host auto_reboot s \"yes\""
+ExecStop = /bin/sh -c "busctl set-property `mapper get-service /org/openbmc/settings/host0` /org/openbmc/settings/host0 org.openbmc.settings.Host auto_reboot s \"no\""
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy={SYSTEMD_DEFAULT_TARGET}
OpenPOWER on IntegriCloud