Merge pull request #22375 from michaelolbrich/watchdog

fix watchdog handling during reboot
This commit is contained in:
Lennart Poettering
2022-02-04 16:28:41 +01:00
committed by GitHub
2 changed files with 7 additions and 2 deletions
+4
View File
@@ -133,6 +133,10 @@ static int open_watchdog(void) {
fn = !watchdog_device || path_equal(watchdog_device, "/dev/watchdog") ?
"/dev/watchdog0" : watchdog_device;
r = free_and_strdup(&watchdog_device, fn);
if (r < 0)
return log_oom_debug();
watchdog_fd = open(fn, O_WRONLY|O_CLOEXEC);
if (watchdog_fd < 0)
return log_debug_errno(errno, "Failed to open watchdog device %s, ignoring: %m", fn);
+3 -2
View File
@@ -531,8 +531,9 @@ int main(int argc, char *argv[]) {
need_md_detach ? " MD devices," : "");
}
/* We're done with the watchdog. */
watchdog_close(true);
/* We're done with the watchdog. Note that the watchdog is explicitly not
* stopped here. It remains active to guard against any issues during the
* rest of the shutdown sequence. */
watchdog_free_device();
arguments[0] = NULL;