1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-11 20:58:27 +03:00
Zbigniew Jędrzejewski-Szmek 0ace9335e1 shared/watchdog: ratelimit the number of attempts to open watchdog
We need to retry to opening of the watchdog, because the device becomes
available asynchronously.

The watchdog is opened in two places:

- in pid1 in the main loop. The loop has a ratelimit, but during a boot we
  iterate in it fairly quickly. On my test VM with 'iTCO_wdt', version 2:

    $ journalctl -b --grep 'Failed to open any watchdog'|wc -l
    3398

  After the device has been processed by udev, it is initialized successfully.

- in shutdown. In that case, we most likely don't need to try more than once,
  because we mostly care about the case where the watchdog device was present
  and configured previously. But in principle it is possible that we might
  attempt shutdown while the machine was initializing, so we don't want to
  disable retries. Nevertheless, watchdog_ping() is called from a loop that
  might be fairly tight, so we could end up trying to reopen the device fairly
  often. This probably doesn't matter *too* much, but it's still ugly to try to
  open the device without any ratelimit.

Usually the watchdog timeout would be set to something like 30 s or a few
minutes. OTOH, on my VM, the device becomes avaiable at 4.35 s after boot. So
let's use 5 s as a value that is small enough to be much smaller than any
normal watchdog timeout, but large enough that we can expect to do no more than
a 1-2 retries during a normal boot.
2024-12-21 10:07:17 +01:00
2022-04-26 09:13:57 +00:00
2024-12-20 09:38:11 +01:00
2024-04-18 17:39:34 +02:00
2024-08-05 15:00:24 +02:00
2024-12-06 18:26:40 +09:00
2023-10-31 13:07:49 +01:00
2024-09-22 15:23:08 +02:00
2024-12-20 09:38:11 +01:00
2024-12-12 11:58:52 +09:00
2024-12-19 12:39:31 +01:00

Systemd

System and Service Manager

Semaphore CI 2.0 Build Status
Coverity Scan Status
OSS-Fuzz Status
CIFuzz
CII Best Practices
Fossies codespell report
Weblate
Coverage Status
Packaging status
OpenSSF Scorecard

Details

Most documentation is available on systemd's web site.

Assorted, older, general information about systemd can be found in the systemd Wiki.

Information about build requirements is provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the Code Map for information about this repository's layout and content.

Please see the Hacking guide for information on how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list, join our IRC channel #systemd on libera.chat or Matrix channel

Stable branches with backported patches are available in the stable repo.

We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack

Description
The systemd System and Service Manager
Readme 566 MiB
Languages
C 89.2%
Python 5.3%
Shell 4.1%
Meson 1.2%