1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 13:09:45 +01:00

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" touch "$oldServiceFiles"
else else
find "$oldUserServicePath" \ find "$oldUserServicePath" \
-maxdepth 1 -name '*.service' -exec basename '{}' ';' \ -maxdepth 1 -name '*.service' \! -name '*@.service' -exec basename '{}' ';' \
| sort \ | sort \
> "$oldServiceFiles" > "$oldServiceFiles"
fi fi
@ -43,7 +43,7 @@ function systemdPostReload() {
touch "$newServiceFiles" touch "$newServiceFiles"
else else
find "$newUserServicePath" \ find "$newUserServicePath" \
-maxdepth 1 -name '*.service' -exec basename '{}' ';' \ -maxdepth 1 -name '*.service' \! -name '*@.service' -exec basename '{}' ';' \
| sort \ | sort \
> "$newServiceFiles" > "$newServiceFiles"
fi fi