URL: https://github.com/SSSD/sssd/pull/132
Author: fidencio
 Title: #132: Add "Wants=" to sssd unit
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/132/head:pr132
git checkout pr132
From e73039251d582f51ff514dca3a11d13bda303655 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fiden...@redhat.com>
Date: Tue, 24 Jan 2017 09:36:34 +0100
Subject: [PATCH] SSSD: Add a list of dependent services to sssd.service
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Let's add a list of dependent services to the sssd unit file so we can
have all those services enable by default when enabling sssd unit.

As it differs from our first approach were all services were disabled by
default, the manuals have also been updated.

Related:
https://fedorahosted.org/sssd/ticket/2243

Signed-off-by: Fabiano FidĂȘncio <fiden...@redhat.com>
---
 Makefile.am                      | 14 +++++++++++++-
 src/man/sssd-sudo.5.xml          |  3 +--
 src/man/sssd.conf.5.xml          |  7 ++++---
 src/sysv/systemd/sssd.service.in |  2 +-
 4 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index ea7648bcd5..ff16a3f5ea 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4618,6 +4618,7 @@ endif
 init_SCRIPTS =
 systemdunit_DATA =
 systemdconf_DATA =
+sssd_dependent_services =
 if HAVE_SYSTEMD_UNIT
     systemdunit_DATA += \
         src/sysv/systemd/sssd.service \
@@ -4629,11 +4630,15 @@ if HAVE_SYSTEMD_UNIT
         src/sysv/systemd/sssd-secrets.socket \
         src/sysv/systemd/sssd-secrets.service \
         $(NULL)
+
+sssd_dependent_services += sssd-nss.socket sssd-pam.socket
 if BUILD_AUTOFS
     systemdunit_DATA += \
         src/sysv/systemd/sssd-autofs.socket \
         src/sysv/systemd/sssd-autofs.service \
         $(NULL)
+
+sssd_dependent_services += sssd-autofs.socket
 endif
 if BUILD_IFP
     systemdunit_DATA += \
@@ -4645,18 +4650,24 @@ if BUILD_PAC_RESPONDER
         src/sysv/systemd/sssd-pac.socket \
         src/sysv/systemd/sssd-pac.service \
         $(NULL)
+
+sssd_dependent_services += sssd-pac.socket
 endif
 if BUILD_SSH
     systemdunit_DATA += \
         src/sysv/systemd/sssd-ssh.socket \
         src/sysv/systemd/sssd-ssh.service \
         $(NULL)
+
+sssd_dependent_services += sssd-ssh.socket
 endif
 if BUILD_SUDO
     systemdunit_DATA += \
         src/sysv/systemd/sssd-sudo.socket \
         src/sysv/systemd/sssd-sudo.service \
         $(NULL)
+
+sssd_dependent_services += sssd-sudo.socket
 endif
 if BUILD_KCM
     systemdunit_DATA += \
@@ -4703,7 +4714,8 @@ edit_cmd = $(SED) \
         -e 's|@libexecdir[@]|$(libexecdir)|g' \
         -e 's|@pipepath[@]|$(pipepath)|g' \
         -e 's|@prefix[@]|$(prefix)|g' \
-        -e 's|@SSSD_USER[@]|$(SSSD_USER)|g'
+        -e 's|@SSSD_USER[@]|$(SSSD_USER)|g' \
+        -e 's|@sssd_dependent_services[@]|${sssd_dependent_services}|g'
 
 replace_script = \
     @rm -f $@ $@.tmp; \
diff --git a/src/man/sssd-sudo.5.xml b/src/man/sssd-sudo.5.xml
index 5bc56c4633..cb085419ab 100644
--- a/src/man/sssd-sudo.5.xml
+++ b/src/man/sssd-sudo.5.xml
@@ -110,8 +110,7 @@ ldap_sudo_search_base = ou=sudoers,dc=example,dc=com
             <phrase condition="have_systemd">
                 It's important to note that on platforms where systemd is supported
                 there's no need to add the "sudo" provider to the list of services,
-                as it became optional. However, sssd-sudo.socket must be enabled
-                instead.
+                as it became optional.
             </phrase>
         </para>
         <para>
diff --git a/src/man/sssd.conf.5.xml b/src/man/sssd.conf.5.xml
index ed3c100128..eda43bafba 100644
--- a/src/man/sssd.conf.5.xml
+++ b/src/man/sssd.conf.5.xml
@@ -220,9 +220,10 @@
                             </para>
                             <para>
                                 <phrase condition="have_systemd">
-                                    By default, all services are disabled and the administrator
-                                    must enable the ones allowed to be used by executing:
-                                    "systemctl enable sssd-@service@.socket".
+                                    By default, all services are enabled.
+                                    In case the Administrator wants to persistently disable
+                                    one of them, it can be done by running:
+                                    "systemctl mask sssd-@service@.socket"
                                 </phrase>
                             </para>
                         </listitem>
diff --git a/src/sysv/systemd/sssd.service.in b/src/sysv/systemd/sssd.service.in
index 0c515d34ca..49c09ea583 100644
--- a/src/sysv/systemd/sssd.service.in
+++ b/src/sysv/systemd/sssd.service.in
@@ -2,7 +2,7 @@
 Description=System Security Services Daemon
 # SSSD must be running before we permit user sessions
 Before=systemd-user-sessions.service nss-user-lookup.target
-Wants=nss-user-lookup.target
+Wants=nss-user-lookup.target @sssd_dependent_services@
 
 [Service]
 Environment=DEBUG_LOGGER=--logger=files
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/sssd-devel@lists.fedorahosted.org/message/UDXJZP7HASS5TLE34NBYSMYRHUJFY67G/

Reply via email to