From 607f969f5dca2dc100cbc53e24ab49ac24ef8987 Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Wed, 26 Jun 2024 17:14:48 +0100 Subject: [PATCH] systemd: don't try to restart templates If the user has template services in their systemd configuration, these can't be restarted, and will produces warnings during the activation phase. Avoid those warnings by skipping any uninstantiated templates when looking for services to start or stop. --- modules/systemd-activate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/systemd-activate.sh b/modules/systemd-activate.sh index 235f1a241..ca26fea8b 100644 --- a/modules/systemd-activate.sh +++ b/modules/systemd-activate.sh @@ -34,7 +34,7 @@ function systemdPostReload() { touch "$oldServiceFiles" else find "$oldUserServicePath" \ - -maxdepth 1 -name '*.service' -exec basename '{}' ';' \ + -maxdepth 1 -name '*.service' \! -name '*@.service' -exec basename '{}' ';' \ | sort \ > "$oldServiceFiles" fi @@ -43,7 +43,7 @@ function systemdPostReload() { touch "$newServiceFiles" else find "$newUserServicePath" \ - -maxdepth 1 -name '*.service' -exec basename '{}' ';' \ + -maxdepth 1 -name '*.service' \! -name '*@.service' -exec basename '{}' ';' \ | sort \ > "$newServiceFiles" fi