diff options
author | Matt Spinler <spinler@us.ibm.com> | 2017-03-16 00:42:54 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-03-17 00:42:13 +0300 |
commit | ab0a9277b1fa99864683a11383beffed743ad4ae (patch) | |
tree | db19b89f51c081883a99ea4f39c1bbd0c3b08096 /meta-phosphor/common/recipes-phosphor/chassis | |
parent | dcb5b7652f9a1e9134bdad60d9de85b9a87e1623 (diff) | |
download | openbmc-ab0a9277b1fa99864683a11383beffed743ad4ae.tar.xz |
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>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/chassis')
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} |