summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2017-03-15 16:42:54 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-03-16 21:42:13 +0000
commitab0a9277b1fa99864683a11383beffed743ad4ae (patch)
treedb19b89f51c081883a99ea4f39c1bbd0c3b08096
parentdcb5b7652f9a1e9134bdad60d9de85b9a87e1623 (diff)
downloadtalos-openbmc-ab0a9277b1fa99864683a11383beffed743ad4ae.tar.gz
talos-openbmc-ab0a9277b1fa99864683a11383beffed743ad4ae.zip
Templatize host-failure-reboots service
This service touches a host0 setting, so it needs to be a template and touch host%i. Change-Id: I9cf84ec40f5fe3aa1ad2c420aaa26d522eece6e1 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
-rw-r--r--meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots.bb7
-rw-r--r--meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots/host-failure-reboots.service13
-rw-r--r--meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots/host-failure-reboots@.service13
3 files changed, 19 insertions, 14 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
index e0f9b8442..645f40cbf 100644
--- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots.bb
+++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots.bb
@@ -6,4 +6,9 @@ PR = "r1"
inherit obmc-phosphor-systemd
inherit obmc-phosphor-license
-SYSTEMD_SERVICE_${PN} += "host-failure-reboots.service"
+TMPL = "host-failure-reboots@.service"
+INSTFMT = "host-failure-reboots@{0}.service"
+LINK_FMT = "${TMPL}:${INSTFMT}"
+
+SYSTEMD_SERVICE_${PN} += "${TMPL}"
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'LINK_FMT', 'OBMC_HOST_INSTANCES')}"
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
deleted file mode 100644
index 81902ae37..000000000
--- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-host-failure-reboots/host-failure-reboots.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[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}
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..67a9aff23
--- /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-host%i.service
+After=mapper-wait@-org-openbmc-settings-host%i.service
+
+[Service]
+ExecStart = /bin/sh -c "busctl set-property `mapper get-service /org/openbmc/settings/host%i` /org/openbmc/settings/host%i org.openbmc.settings.Host auto_reboot s \"yes\""
+ExecStop = /bin/sh -c "busctl set-property `mapper get-service /org/openbmc/settings/host%i` /org/openbmc/settings/host%i org.openbmc.settings.Host auto_reboot s \"no\""
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy={SYSTEMD_DEFAULT_TARGET}
OpenPOWER on IntegriCloud