* [PATCH 0/1] systemd: Set RebootWatchdogSec to 60s as watchdog @ 2022-05-27 7:07 Robert Yang 2022-05-27 7:07 ` [PATCH 1/1] " Robert Yang 0 siblings, 1 reply; 4+ messages in thread From: Robert Yang @ 2022-05-27 7:07 UTC (permalink / raw) To: openembedded-core The following changes since commit 579906b9f4ea32c8d4e0e11a87ee6c9e27cdf0dc: kernel.bbclass: Do not overwrite recipe's custom postinst (2022-05-23 21:31:07 +0100) are available in the Git repository at: git://git.openembedded.org/openembedded-core-contrib rbt/watdog http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/watdog Robert Yang (1): systemd: Set RebootWatchdogSec to 60s as watchdog meta/recipes-core/systemd/systemd_250.5.bb | 8 ++++++++ meta/recipes-extended/watchdog/watchdog-config.bb | 7 +++++++ 2 files changed, 15 insertions(+) -- 2.35.1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] systemd: Set RebootWatchdogSec to 60s as watchdog 2022-05-27 7:07 [PATCH 0/1] systemd: Set RebootWatchdogSec to 60s as watchdog Robert Yang @ 2022-05-27 7:07 ` Robert Yang 2022-05-27 19:12 ` [OE-core] " Alexander Kanavin 0 siblings, 1 reply; 4+ messages in thread From: Robert Yang @ 2022-05-27 7:07 UTC (permalink / raw) To: openembedded-core 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> --- meta/recipes-core/systemd/systemd_250.5.bb | 8 ++++++++ meta/recipes-extended/watchdog/watchdog-config.bb | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/meta/recipes-core/systemd/systemd_250.5.bb b/meta/recipes-core/systemd/systemd_250.5.bb index 006b2f86eab..6fac27ee56d 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 (){ diff --git a/meta/recipes-extended/watchdog/watchdog-config.bb b/meta/recipes-extended/watchdog/watchdog-config.bb index a28d28033bc..f1389521284 100644 --- a/meta/recipes-extended/watchdog/watchdog-config.bb +++ b/meta/recipes-extended/watchdog/watchdog-config.bb @@ -13,8 +13,15 @@ SRC_URI = " \ file://watchdog.conf \ " +# The default value is 60 seconds when null. +WATCHDOG_TIMEOUT ??= "" + do_install() { install -Dm 0644 ${WORKDIR}/watchdog.default ${D}${sysconfdir}/default/watchdog install -Dm 0644 ${WORKDIR}/watchdog.conf ${D}${sysconfdir}/watchdog.conf + + if [ -n "${WATCHDOG_TIMEOUT}" ]; then + echo "watchdog-timeout = ${WATCHDOG_TIMEOUT}" >> ${D}/etc/watchdog.conf + fi } -- 2.35.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [OE-core] [PATCH 1/1] systemd: Set RebootWatchdogSec to 60s as watchdog 2022-05-27 7:07 ` [PATCH 1/1] " Robert Yang @ 2022-05-27 19:12 ` Alexander Kanavin 2022-05-28 8:49 ` Robert Yang 0 siblings, 1 reply; 4+ messages in thread From: Alexander Kanavin @ 2022-05-27 19:12 UTC (permalink / raw) To: Robert Yang; +Cc: OE-core Where is the default of 10 minutes set? Should it be fixed there? Patching things with sed after the fact is not necessarily a good idea. Alex On Fri, 27 May 2022 at 09:07, Robert Yang <liezhi.yang@windriver.com> wrote: > > 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> > --- > meta/recipes-core/systemd/systemd_250.5.bb | 8 ++++++++ > meta/recipes-extended/watchdog/watchdog-config.bb | 7 +++++++ > 2 files changed, 15 insertions(+) > > diff --git a/meta/recipes-core/systemd/systemd_250.5.bb b/meta/recipes-core/systemd/systemd_250.5.bb > index 006b2f86eab..6fac27ee56d 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 (){ > diff --git a/meta/recipes-extended/watchdog/watchdog-config.bb b/meta/recipes-extended/watchdog/watchdog-config.bb > index a28d28033bc..f1389521284 100644 > --- a/meta/recipes-extended/watchdog/watchdog-config.bb > +++ b/meta/recipes-extended/watchdog/watchdog-config.bb > @@ -13,8 +13,15 @@ SRC_URI = " \ > file://watchdog.conf \ > " > > +# The default value is 60 seconds when null. > +WATCHDOG_TIMEOUT ??= "" > + > do_install() { > install -Dm 0644 ${WORKDIR}/watchdog.default ${D}${sysconfdir}/default/watchdog > install -Dm 0644 ${WORKDIR}/watchdog.conf ${D}${sysconfdir}/watchdog.conf > + > + if [ -n "${WATCHDOG_TIMEOUT}" ]; then > + echo "watchdog-timeout = ${WATCHDOG_TIMEOUT}" >> ${D}/etc/watchdog.conf > + fi > } > > -- > 2.35.1 > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#166202): https://lists.openembedded.org/g/openembedded-core/message/166202 > Mute This Topic: https://lists.openembedded.org/mt/91371988/1686489 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [OE-core] [PATCH 1/1] systemd: Set RebootWatchdogSec to 60s as watchdog 2022-05-27 19:12 ` [OE-core] " Alexander Kanavin @ 2022-05-28 8:49 ` Robert Yang 0 siblings, 0 replies; 4+ messages in thread From: Robert Yang @ 2022-05-28 8:49 UTC (permalink / raw) To: Alexander Kanavin; +Cc: OE-core Hi Alexander, On 5/28/22 03:12, Alexander Kanavin wrote: > Where is the default of 10 minutes set? Should it be fixed there? > Patching things with sed after the fact is not necessarily a good > idea. It's set in src/core/main.c, line 2451: arg_reboot_watchdog = 10 * USEC_PER_MINUTE; The ${sysconfdir}/systemd/system.conf is used for configing it, so I didn't modify src/core/main.c, and even if we modify src/core/main.c, we still need config the value depend on the boards, for example, rpi4 (max: 15 seconds), nxp-imx8 (max: 128 seconds), other boards may have a higher or lower value than 60. // Robert > > Alex > > On Fri, 27 May 2022 at 09:07, Robert Yang <liezhi.yang@windriver.com> wrote: >> >> 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> >> --- >> meta/recipes-core/systemd/systemd_250.5.bb | 8 ++++++++ >> meta/recipes-extended/watchdog/watchdog-config.bb | 7 +++++++ >> 2 files changed, 15 insertions(+) >> >> diff --git a/meta/recipes-core/systemd/systemd_250.5.bb b/meta/recipes-core/systemd/systemd_250.5.bb >> index 006b2f86eab..6fac27ee56d 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 (){ >> diff --git a/meta/recipes-extended/watchdog/watchdog-config.bb b/meta/recipes-extended/watchdog/watchdog-config.bb >> index a28d28033bc..f1389521284 100644 >> --- a/meta/recipes-extended/watchdog/watchdog-config.bb >> +++ b/meta/recipes-extended/watchdog/watchdog-config.bb >> @@ -13,8 +13,15 @@ SRC_URI = " \ >> file://watchdog.conf \ >> " >> >> +# The default value is 60 seconds when null. >> +WATCHDOG_TIMEOUT ??= "" >> + >> do_install() { >> install -Dm 0644 ${WORKDIR}/watchdog.default ${D}${sysconfdir}/default/watchdog >> install -Dm 0644 ${WORKDIR}/watchdog.conf ${D}${sysconfdir}/watchdog.conf >> + >> + if [ -n "${WATCHDOG_TIMEOUT}" ]; then >> + echo "watchdog-timeout = ${WATCHDOG_TIMEOUT}" >> ${D}/etc/watchdog.conf >> + fi >> } >> >> -- >> 2.35.1 >> >> >> -=-=-=-=-=-=-=-=-=-=-=- >> Links: You receive all messages sent to this group. >> View/Reply Online (#166202): https://lists.openembedded.org/g/openembedded-core/message/166202 >> Mute This Topic: https://lists.openembedded.org/mt/91371988/1686489 >> Group Owner: openembedded-core+owner@lists.openembedded.org >> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com] >> -=-=-=-=-=-=-=-=-=-=-=- >> ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-05-28 8:49 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-05-27 7:07 [PATCH 0/1] systemd: Set RebootWatchdogSec to 60s as watchdog Robert Yang 2022-05-27 7:07 ` [PATCH 1/1] " Robert Yang 2022-05-27 19:12 ` [OE-core] " Alexander Kanavin 2022-05-28 8:49 ` Robert Yang
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.