29fc725
From 3d6d125917073b06849c336c93e475a5a43c0dd9 Mon Sep 17 00:00:00 2001
29fc725
From: Stephen Gallagher <sgallagh@redhat.com>
29fc725
Date: Fri, 17 Oct 2014 11:43:39 -0400
29fc725
Subject: systemd: ensure that accounts service starts after NSS initializes
29fc725
29fc725
The various NSS calls don't give accurate results in some configurations
29fc725
until midway through boot up.  This is because SSSD or winbind (or
29fc725
whatever) needs to initialize.
29fc725
29fc725
In order to prevent accounts service from using NSS prematurely, we need
29fc725
to add an ordering constraint between the nss-user-lookup.target and
29fc725
accountsservice.
29fc725
29fc725
This commit accomplishes this by adding the appropriate Wants= and
29fc725
After= directives to the accountsservice systemd unit file.
29fc725
29fc725
diff --git a/data/accounts-daemon.service.in b/data/accounts-daemon.service.in
29fc725
index 105bf6a..feedf3e 100644
29fc725
--- a/data/accounts-daemon.service.in
29fc725
+++ b/data/accounts-daemon.service.in
29fc725
@@ -1,6 +1,12 @@
29fc725
 [Unit]
29fc725
 Description=Accounts Service
29fc725
 
29fc725
+# In order to avoid races with identity-providing services like SSSD or
29fc725
+# winbind, we need to ensure that Accounts Service starts after
29fc725
+# nss-user-lookup.target
29fc725
+After=nss-user-lookup.target
29fc725
+Wants=nss-user-lookup.target
29fc725
+
29fc725
 [Service]
29fc725
 Type=dbus
29fc725
 BusName=org.freedesktop.Accounts
29fc725
-- 
29fc725
cgit v0.10.2
29fc725
29fc725