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.
This commit is contained in:
Adam Dinwoodie 2024-06-26 17:14:48 +01:00 committed by GitHub
parent 7a88ff6ad1
commit 607f969f5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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