diff options
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} |