diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2022-05-26 23:23:14 -0700 |
---|---|---|
committer | Robert Yang <liezhi.yang@windriver.com> | 2022-05-27 00:05:42 -0700 |
commit | c05b2737acb3c1b1d91085eb38c183214f478c62 (patch) | |
tree | 83abb7254c50b7cbb5129c27397bbcacec11d5eb /meta/recipes-core | |
parent | 579906b9f4ea32c8d4e0e11a87ee6c9e27cdf0dc (diff) | |
download | openembedded-core-contrib-rbt/watdog.tar.gz |
systemd: Set RebootWatchdogSec to 60s as watchdogrbt/watdog
The systemd-shutdown sets watchdog timeout to 10m (600 seconds) which is too
large, and caused errors when reboot on boars such as rpi4:
systemd-shutdown[1]: Failed to set timeout to 10min: Invalid argument
The watchog's default value is 60s, so set RebootWatchdogSec to 60s to fix the
errors. And <machin.conf> can set WATCHDOG_TIMEOUT when needed, for example,
the max timeout of rpi4 is 15 seconds.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/systemd/systemd_250.5.bb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_250.5.bb b/meta/recipes-core/systemd/systemd_250.5.bb index 006b2f86ea..6fac27ee56 100644 --- a/meta/recipes-core/systemd/systemd_250.5.bb +++ b/meta/recipes-core/systemd/systemd_250.5.bb @@ -238,6 +238,9 @@ EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \ -Dnologin-path=${base_sbindir}/nologin \ -Dumount-path=${base_bindir}/umount" +# The 60 seconds is watchdog's default vaule. +WATCHDOG_TIMEOUT ??= "60" + do_install() { meson_do_install install -d ${D}/${base_sbindir} @@ -337,6 +340,11 @@ do_install() { # add a profile fragment to disable systemd pager with busybox less install -Dm 0644 ${WORKDIR}/systemd-pager.sh ${D}${sysconfdir}/profile.d/systemd-pager.sh + + if [ -n "${WATCHDOG_TIMEOUT}" ]; then + sed -i -e 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \ + ${D}/${sysconfdir}/systemd/system.conf + fi } python populate_packages:prepend (){ |