From e6970b4909a288cd9f4081b7b42ab67cdeb5877b Mon Sep 17 00:00:00 2001 From: Vincent Chou Date: Thu, 13 Oct 2022 09:30:32 -0500 Subject: meta-fii: meta-mori: Add watchdog support with fallback Add watchdog service to monitor the host status and execute the expire actions when host doesn't reset the watchdog timer. Add fallback support to the watchdog with the interval set to 10 minutes. Timer is reset with changes to host boot progress. If the host fails to reset the watchdog, then the watchdog action is performed with fallback to AC cycle after 10 minutes. Signed-off-by: Vincent Chou Change-Id: Id0905ebc72405713806bbe2d803e6ca559488495 --- .../watchdog/phosphor-watchdog/obmc/watchdog/host0 | 8 ++++++++ .../phosphor-watchdog/phosphor-watchdog.service | 21 +++++++++++++++++++++ .../watchdog/phosphor-watchdog_%.bbappend | 9 +++++++++ 3 files changed, 38 insertions(+) create mode 100644 meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0 create mode 100644 meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service create mode 100644 meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend (limited to 'meta-fii/meta-mori') diff --git a/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0 b/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0 new file mode 100644 index 0000000000..466f08d4b6 --- /dev/null +++ b/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0 @@ -0,0 +1,8 @@ +DEVPATH=/xyz/openbmc_project/watchdog/host0 +SERVICE=xyz.openbmc_project.Watchdog +UNIT_HARD_RESET=ampere-host-power-cycle.service +UNIT_POWER_OFF=ampere-chassis-poweroff.service +UNIT_POWER_CYCLE=ampere-chassis-powercycle.service +FALLBACK_ACTION=xyz.openbmc_project.State.Watchdog.Action.PowerCycle +FALLBACK_INTERVAL=600000 +MIN_INTERVAL=60000 diff --git a/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service b/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service new file mode 100644 index 0000000000..003f479223 --- /dev/null +++ b/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service @@ -0,0 +1,21 @@ +[Unit] +Description=Phosphor Watchdog + +[Service] +EnvironmentFile={envfiledir}/obmc/watchdog/host0 + +ExecStart=phosphor-watchdog --service=${{SERVICE}} --path=${{DEVPATH}} --watch_postcodes \ + --continue --fallback_always --min_interval=${{MIN_INTERVAL}} \ + --fallback_action=${{FALLBACK_ACTION}} --fallback_interval=${{FALLBACK_INTERVAL}} \ + --action_target=xyz.openbmc_project.State.Watchdog.Action.HardReset=${{UNIT_HARD_RESET}} \ + --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerOff=${{UNIT_POWER_OFF}} \ + --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerCycle=${{UNIT_POWER_CYCLE}} \ + +# This should use state manager instead of the service files currently defined + +SyslogIdentifier=phosphor-watchdog +BusName=xyz.openbmc_project.Watchdog +Type=dbus + +[Install] +WantedBy=basic.target diff --git a/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend b/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend new file mode 100644 index 0000000000..6a70555723 --- /dev/null +++ b/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend @@ -0,0 +1,9 @@ +FILESEXTRAPATHS:prepend:mori := "${THISDIR}/${PN}:" +SYSTEMD_ENVIRONMENT_FILE:${PN}:append:mori = " obmc/watchdog/host0" + +SYSTEMD_LINK:${PN}:remove:mori = "${@compose_list(d, 'ENABLE_WATCHDOG_FMT', 'OBMC_HOST_INSTANCES')}" +SYSTEMD_LINK:${PN}:remove:mori = "${@compose_list(d, 'WATCHDOG_FMT', 'OBMC_HOST_WATCHDOG_INSTANCES', 'OBMC_HOST_INSTANCES')}" +# Remove the override to keep service running after DC cycle +SYSTEMD_OVERRIDE_${PN}:remove:mori = "poweron.conf:phosphor-watchdog@poweron.service.d/poweron.conf" +SYSTEMD_SERVICE:${PN}:mori = " phosphor-watchdog.service \ + " -- cgit v1.2.3