Merge pull request #292847 from jwillikers/linger-hotfix

Fix the update-lingering activation script to not fail when a user is removed
This commit is contained in:
maxine
2024-03-08 09:54:44 +00:00
committed by GitHub
+5
View File
@@ -704,6 +704,11 @@ in {
in stringAfter [ "users" ] ''
if [ -e ${lingerDir} ] ; then
cd ${lingerDir}
for user in ${lingerDir}/*; do
if ! id "$user" >/dev/null 2>&1; then
rm --force -- "$user"
fi
done
ls ${lingerDir} | sort | comm -3 -1 ${lingeringUsersFile} - | xargs -r ${pkgs.systemd}/bin/loginctl disable-linger
ls ${lingerDir} | sort | comm -3 -2 ${lingeringUsersFile} - | xargs -r ${pkgs.systemd}/bin/loginctl enable-linger
fi