From 5743a9da0b350e86a176fe5fc52d804ce59da056 Mon Sep 17 00:00:00 2001
From: chrfranke <chrfranke@4ea69e1a-61f1-4043-bf83-b5c94c648137>
Date: Sat, 6 Aug 2022 15:19:43 +0000
Subject: [PATCH] smartd.cpp: Also prevent systemd unit startup timeout in
 `CheckDevicesOnce`.

Patch by GH user 'themylogin' (GH pull/141).

git-svn-id: https://svn.code.sf.net/p/smartmontools/code/trunk@5401 4ea69e1a-61f1-4043-bf83-b5c94c648137
---
 smartmontools/ChangeLog  | 5 +++++
 smartmontools/smartd.cpp | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/smartmontools/ChangeLog b/smartmontools/ChangeLog
index 9d46f9404..0612a64f0 100644
--- a/smartmontools/ChangeLog
+++ b/smartmontools/ChangeLog
@@ -1,5 +1,10 @@
 $Id$
 
+2022-08-06  themylogin  <themylogin@gmail.com>
+
+	smartd.cpp: Also prevent systemd unit startup timeout in
+	`CheckDevicesOnce` (GH pull/141).
+
 2022-08-06  Christian Franke  <franke@computer.org>
 
 	drivedb.h:
diff --git a/smartmontools/smartd.cpp b/smartmontools/smartd.cpp
index 2b3c81c18..0e0503fb6 100644
--- a/smartmontools/smartd.cpp
+++ b/smartmontools/smartd.cpp
@@ -3956,6 +3956,9 @@ static void CheckDevicesOnce(const dev_config_vector & configs, dev_state_vector
       SCSICheckDevice(cfg, state, dev->to_scsi(), allow_selftests);
     else if (dev->is_nvme())
       NVMeCheckDevice(cfg, state, dev->to_nvme());
+
+    // Prevent systemd unit startup timeout when checking many devices on startup
+    notify_extend_timeout();
   }
 
   do_disable_standby_check(configs, states);
-- 
GitLab