watchdog: Support changing watchdog_usec during runtime
authorKunhoon Baik <knhoon.baik@samsung.com>
Fri, 26 Aug 2016 04:22:20 +0000 (13:22 +0900)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Fri, 26 Jan 2024 16:49:49 +0000 (17:49 +0100)
commit7607bbc954fd462ac0ab77bfd3716f14882077ca
treee7ed5ca21d3833428ae40454031a86edf5fd915e
parent294929f67cb1afcf4a8457831742ed61ebdaf0d6
watchdog: Support changing watchdog_usec during runtime
 (#3492)

Add sd_notify() parameter to change watchdog_usec during runtime.

Application can change watchdog_usec value by
sd_notify like this. Example. sd_notify(0, "WATCHDOG_USEC=20000000").

To reset watchdog_usec as configured value in service file,
restart service.

Notice.
sd_event is not currently supported. If application uses
sd_event_set_watchdog, or sd_watchdog_enabled, do not use
"WATCHDOG_USEC" option through sd_notify.

Origin: https://github.com/systemd/systemd/commit/2787d83c2
Note: There are two additional patches for clean backport patch
      1)rework unit timeout patch - https://github.com/systemd/systemd/commit/36c16a7cd
      2)rework per-object logging - https://github.com/systemd/systemd/commit/f2341e0a8
      However, we will not apply the patch for minimal backport

Change-Id: Ic1a91dc4e611f3e92fdc734fb1eb70e27244aa37
src/core/service.c