dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0018-SYSTEMD-Replace-parameter-debug-to-files-with-DEBUG_.patch

9f2ebf
From 66cdb732268cc8dfd4f0800178d1cc186de83ef7 Mon Sep 17 00:00:00 2001
9f2ebf
From: Lukas Slebodnik <lslebodn@redhat.com>
9f2ebf
Date: Mon, 23 Oct 2017 18:03:46 +0200
9f2ebf
Subject: [PATCH 18/21] SYSTEMD: Replace parameter --debug-to-files with
9f2ebf
 ${DEBUG_LOGGER}
9f2ebf
MIME-Version: 1.0
9f2ebf
Content-Type: text/plain; charset=UTF-8
9f2ebf
Content-Transfer-Encoding: 8bit
9f2ebf
9f2ebf
Users can set variable DEBUG_LOGGER in environment files
9f2ebf
(/etc/sysconfig/sssd or /etc/default/sssd; depending on the distribution)
9f2ebf
to override default logging to files.
9f2ebf
9f2ebf
e.g.
9f2ebf
DEBUG_LOGGER=--logger=stderr
9f2ebf
DEBUG_LOGGER=--logger=journald
9f2ebf
9f2ebf
Resolves:
9f2ebf
https://pagure.io/SSSD/sssd/issue/3433
9f2ebf
9f2ebf
Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
9f2ebf
(cherry picked from commit a7277fecf7a65ab6c83b36f009c558cdfbf997d2)
9f2ebf
---
9f2ebf
 Makefile.am                              | 12 +-----------
9f2ebf
 contrib/sssd.spec.in                     |  4 ----
9f2ebf
 src/sysv/systemd/journal.conf.in         |  7 -------
9f2ebf
 src/sysv/systemd/sssd-autofs.service.in  |  3 ++-
9f2ebf
 src/sysv/systemd/sssd-ifp.service.in     |  3 ++-
9f2ebf
 src/sysv/systemd/sssd-kcm.service.in     |  3 ++-
9f2ebf
 src/sysv/systemd/sssd-nss.service.in     |  3 ++-
9f2ebf
 src/sysv/systemd/sssd-pac.service.in     |  3 ++-
9f2ebf
 src/sysv/systemd/sssd-pam.service.in     |  3 ++-
9f2ebf
 src/sysv/systemd/sssd-secrets.service.in |  3 ++-
9f2ebf
 src/sysv/systemd/sssd-ssh.service.in     |  3 ++-
9f2ebf
 src/sysv/systemd/sssd-sudo.service.in    |  3 ++-
9f2ebf
 src/sysv/systemd/sssd.service.in         |  3 ++-
9f2ebf
 13 files changed, 21 insertions(+), 32 deletions(-)
9f2ebf
 delete mode 100644 src/sysv/systemd/journal.conf.in
9f2ebf
9f2ebf
diff --git a/Makefile.am b/Makefile.am
9f2ebf
index 41a8f32f4e76fdcbd09ad833161f0bdada19e389..5483375167d99568e8313c9a0488900419be6ec3 100644
9f2ebf
--- a/Makefile.am
9f2ebf
+++ b/Makefile.am
9f2ebf
@@ -91,7 +91,7 @@ sssdkcmdatadir = $(datadir)/sssd-kcm
9f2ebf
 deskprofilepath = $(sss_statedir)/deskprofile
9f2ebf
 
9f2ebf
 if HAVE_SYSTEMD_UNIT
9f2ebf
-ifp_exec_cmd = $(sssdlibexecdir)/sssd_ifp --uid 0 --gid 0 --debug-to-files --dbus-activated
9f2ebf
+ifp_exec_cmd = $(sssdlibexecdir)/sssd_ifp --uid 0 --gid 0 --dbus-activated
9f2ebf
 ifp_systemdservice = SystemdService=sssd-ifp.service
9f2ebf
 ifp_restart = Restart=on-failure
9f2ebf
 else
9f2ebf
@@ -4483,10 +4483,6 @@ if BUILD_KCM
9f2ebf
         src/sysv/systemd/sssd-kcm.service \
9f2ebf
         $(NULL)
9f2ebf
 endif
9f2ebf
-if WITH_JOURNALD
9f2ebf
-    systemdconf_DATA += \
9f2ebf
-        src/sysv/systemd/journal.conf
9f2ebf
-endif
9f2ebf
 else
9f2ebf
 if HAVE_SUSE
9f2ebf
     init_SCRIPTS += \
9f2ebf
@@ -4535,7 +4531,6 @@ replace_script = \
9f2ebf
 
9f2ebf
 EXTRA_DIST += \
9f2ebf
     src/sysv/systemd/sssd.service.in \
9f2ebf
-    src/sysv/systemd/journal.conf.in \
9f2ebf
     src/sysv/systemd/sssd-nss.socket.in \
9f2ebf
     src/sysv/systemd/sssd-nss.service.in \
9f2ebf
     src/sysv/systemd/sssd-pam.socket.in \
9f2ebf
@@ -4585,10 +4580,6 @@ src/sysv/systemd/sssd.service: src/sysv/systemd/sssd.service.in Makefile
9f2ebf
 	@$(MKDIR_P) src/sysv/systemd/
9f2ebf
 	$(replace_script)
9f2ebf
 
9f2ebf
-src/sysv/systemd/journal.conf: src/sysv/systemd/journal.conf.in Makefile
9f2ebf
-	@$(MKDIR_P) src/sysv/systemd/
9f2ebf
-	$(replace_script)
9f2ebf
-
9f2ebf
 src/sysv/systemd/sssd-nss.socket: src/sysv/systemd/sssd-nss.socket.in Makefile
9f2ebf
 	@$(MKDIR_P) src/sysv/systemd/
9f2ebf
 	$(replace_script)
9f2ebf
@@ -4924,7 +4915,6 @@ endif
9f2ebf
 	rm -f $(builddir)/src/sysv/systemd/sssd-secrets.service
9f2ebf
 	rm -f $(builddir)/src/sysv/systemd/sssd-kcm.socket
9f2ebf
 	rm -f $(builddir)/src/sysv/systemd/sssd-kcm.service
9f2ebf
-	rm -f $(builddir)/src/sysv/systemd/journal.conf
9f2ebf
 	rm -f $(builddir)/src/tools/wrappers/sss_debuglevel
9f2ebf
 
9f2ebf
 CLEANFILES += *.X */*.X */*/*.X
9f2ebf
diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
9f2ebf
index e76b51833d5dfa3207d28add4af1016c00f25e1f..1ee64d5a2a64635984260fceced779f4804e8b31 100644
9f2ebf
--- a/contrib/sssd.spec.in
9f2ebf
+++ b/contrib/sssd.spec.in
9f2ebf
@@ -971,10 +971,6 @@ done
9f2ebf
 %attr(711,sssd,sssd) %dir %{_sysconfdir}/sssd
9f2ebf
 %attr(711,sssd,sssd) %dir %{_sysconfdir}/sssd/conf.d
9f2ebf
 %ghost %attr(0600,sssd,sssd) %config(noreplace) %{_sysconfdir}/sssd/sssd.conf
9f2ebf
-%if (0%{?use_systemd} == 1)
9f2ebf
-%attr(755,root,root) %dir %{_sysconfdir}/systemd/system/sssd.service.d
9f2ebf
-%config(noreplace) %{_sysconfdir}/systemd/system/sssd.service.d/journal.conf
9f2ebf
-%endif
9f2ebf
 %dir %{_sysconfdir}/logrotate.d
9f2ebf
 %config(noreplace) %{_sysconfdir}/logrotate.d/sssd
9f2ebf
 %dir %{_sysconfdir}/rwtab.d
9f2ebf
diff --git a/src/sysv/systemd/journal.conf.in b/src/sysv/systemd/journal.conf.in
9f2ebf
deleted file mode 100644
9f2ebf
index 9ce170b4893629792516aab41573adea1fb741f0..0000000000000000000000000000000000000000
9f2ebf
--- a/src/sysv/systemd/journal.conf.in
9f2ebf
+++ /dev/null
9f2ebf
@@ -1,7 +0,0 @@
9f2ebf
-[Service]
9f2ebf
-# Uncomment *both* of the following lines to enable debug logging
9f2ebf
-# to go to journald instead of /var/log/sssd. You will need to
9f2ebf
-# run 'systemctl daemon-reload' and then restart the SSSD service
9f2ebf
-# for this to take effect
9f2ebf
-#ExecStart=
9f2ebf
-#ExecStart=@sbindir@/sssd -i
9f2ebf
diff --git a/src/sysv/systemd/sssd-autofs.service.in b/src/sysv/systemd/sssd-autofs.service.in
9f2ebf
index 32ea6e19ca7f9aa65599c0cf296a8c5e73362271..c2dc254c8f3f56cb6ae4dc481781688aa702b102 100644
9f2ebf
--- a/src/sysv/systemd/sssd-autofs.service.in
9f2ebf
+++ b/src/sysv/systemd/sssd-autofs.service.in
9f2ebf
@@ -9,8 +9,9 @@ RefuseManualStart=true
9f2ebf
 Also=sssd-autofs.socket
9f2ebf
 
9f2ebf
 [Service]
9f2ebf
+Environment=DEBUG_LOGGER=--logger=files
9f2ebf
 ExecStartPre=-/bin/chown @SSSD_USER@:@SSSD_USER@ @logpath@/sssd_autofs.log
9f2ebf
-ExecStart=@libexecdir@/sssd/sssd_autofs --debug-to-files --socket-activated
9f2ebf
+ExecStart=@libexecdir@/sssd/sssd_autofs ${DEBUG_LOGGER} --socket-activated
9f2ebf
 Restart=on-failure
9f2ebf
 User=@SSSD_USER@
9f2ebf
 Group=@SSSD_USER@
9f2ebf
diff --git a/src/sysv/systemd/sssd-ifp.service.in b/src/sysv/systemd/sssd-ifp.service.in
9f2ebf
index 8e7abdb0e8c5ec83f9423c688daf845a16c57e7e..05a9a602b2d27c54a4faa79c58e0ecba90267100 100644
9f2ebf
--- a/src/sysv/systemd/sssd-ifp.service.in
9f2ebf
+++ b/src/sysv/systemd/sssd-ifp.service.in
9f2ebf
@@ -5,7 +5,8 @@ After=sssd.service
9f2ebf
 BindsTo=sssd.service
9f2ebf
 
9f2ebf
 [Service]
9f2ebf
+Environment=DEBUG_LOGGER=--logger=files
9f2ebf
 Type=dbus
9f2ebf
 BusName=org.freedesktop.sssd.infopipe
9f2ebf
-ExecStart=@ifp_exec_cmd@
9f2ebf
+ExecStart=@ifp_exec_cmd@ ${DEBUG_LOGGER}
9f2ebf
 @ifp_restart@
9f2ebf
diff --git a/src/sysv/systemd/sssd-kcm.service.in b/src/sysv/systemd/sssd-kcm.service.in
9f2ebf
index 1e2bee12dc3bedd17d41b86f91c9b2b52d985c40..92306f97ec73a775739bfdb4454df14956e5e133 100644
9f2ebf
--- a/src/sysv/systemd/sssd-kcm.service.in
9f2ebf
+++ b/src/sysv/systemd/sssd-kcm.service.in
9f2ebf
@@ -6,4 +6,5 @@ Documentation=man:sssd-kcm(5)
9f2ebf
 Also=sssd-kcm.socket
9f2ebf
 
9f2ebf
 [Service]
9f2ebf
-ExecStart=@libexecdir@/sssd/sssd_kcm --uid 0 --gid 0 --debug-to-files
9f2ebf
+Environment=DEBUG_LOGGER=--logger=files
9f2ebf
+ExecStart=@libexecdir@/sssd/sssd_kcm --uid 0 --gid 0 ${DEBUG_LOGGER}
9f2ebf
diff --git a/src/sysv/systemd/sssd-nss.service.in b/src/sysv/systemd/sssd-nss.service.in
9f2ebf
index 6a29078d5a36dff229e47bf7ce953e46443ce023..fe771ad0fa99968bb1d42037abf2f960271589b1 100644
9f2ebf
--- a/src/sysv/systemd/sssd-nss.service.in
9f2ebf
+++ b/src/sysv/systemd/sssd-nss.service.in
9f2ebf
@@ -9,5 +9,6 @@ RefuseManualStart=true
9f2ebf
 Also=sssd-nss.socket
9f2ebf
 
9f2ebf
 [Service]
9f2ebf
-ExecStart=@libexecdir@/sssd/sssd_nss --debug-to-files --socket-activated
9f2ebf
+Environment=DEBUG_LOGGER=--logger=files
9f2ebf
+ExecStart=@libexecdir@/sssd/sssd_nss ${DEBUG_LOGGER} --socket-activated
9f2ebf
 Restart=on-failure
9f2ebf
diff --git a/src/sysv/systemd/sssd-pac.service.in b/src/sysv/systemd/sssd-pac.service.in
9f2ebf
index ffbfdec030ba6d5cf75c989854c27bc46b6983a5..dbd25abc476f579c9d8cce171fdeafa06e567610 100644
9f2ebf
--- a/src/sysv/systemd/sssd-pac.service.in
9f2ebf
+++ b/src/sysv/systemd/sssd-pac.service.in
9f2ebf
@@ -9,8 +9,9 @@ RefuseManualStart=true
9f2ebf
 Also=sssd-pac.socket
9f2ebf
 
9f2ebf
 [Service]
9f2ebf
+Environment=DEBUG_LOGGER=--logger=files
9f2ebf
 ExecStartPre=-/bin/chown @SSSD_USER@:@SSSD_USER@ @logpath@/sssd_pac.log
9f2ebf
-ExecStart=@libexecdir@/sssd/sssd_pac --debug-to-files --socket-activated
9f2ebf
+ExecStart=@libexecdir@/sssd/sssd_pac ${DEBUG_LOGGER} --socket-activated
9f2ebf
 Restart=on-failure
9f2ebf
 User=@SSSD_USER@
9f2ebf
 Group=@SSSD_USER@
9f2ebf
diff --git a/src/sysv/systemd/sssd-pam.service.in b/src/sysv/systemd/sssd-pam.service.in
9f2ebf
index 6dec46f0c5d384c500268dafcd00af894088e0b6..df722d1f3014bf62cc60114c30331424d14f411b 100644
9f2ebf
--- a/src/sysv/systemd/sssd-pam.service.in
9f2ebf
+++ b/src/sysv/systemd/sssd-pam.service.in
9f2ebf
@@ -9,8 +9,9 @@ RefuseManualStart=true
9f2ebf
 Also=sssd-pam.socket sssd-pam-priv.socket
9f2ebf
 
9f2ebf
 [Service]
9f2ebf
+Environment=DEBUG_LOGGER=--logger=files
9f2ebf
 ExecStartPre=-/bin/chown @SSSD_USER@:@SSSD_USER@ @logpath@/sssd_pam.log
9f2ebf
-ExecStart=@libexecdir@/sssd/sssd_pam --debug-to-files --socket-activated
9f2ebf
+ExecStart=@libexecdir@/sssd/sssd_pam ${DEBUG_LOGGER} --socket-activated
9f2ebf
 Restart=on-failure
9f2ebf
 User=@SSSD_USER@
9f2ebf
 Group=@SSSD_USER@
9f2ebf
diff --git a/src/sysv/systemd/sssd-secrets.service.in b/src/sysv/systemd/sssd-secrets.service.in
9f2ebf
index f45d647677a62900c01c7eb103597f2b1387498c..a7b41e0b16a5fa882546b41047e616fd2140329f 100644
9f2ebf
--- a/src/sysv/systemd/sssd-secrets.service.in
9f2ebf
+++ b/src/sysv/systemd/sssd-secrets.service.in
9f2ebf
@@ -6,4 +6,5 @@ Documentation=man:sssd-secrets(5)
9f2ebf
 Also=sssd-secrets.socket
9f2ebf
 
9f2ebf
 [Service]
9f2ebf
-ExecStart=@libexecdir@/sssd/sssd_secrets --uid 0 --gid 0 --debug-to-files
9f2ebf
+Environment=DEBUG_LOGGER=--logger=files
9f2ebf
+ExecStart=@libexecdir@/sssd/sssd_secrets --uid 0 --gid 0 ${DEBUG_LOGGER}
9f2ebf
diff --git a/src/sysv/systemd/sssd-ssh.service.in b/src/sysv/systemd/sssd-ssh.service.in
9f2ebf
index 6f233b4854018d79cc0ad9d67d53ebd67a49f7b7..f41249ea0fe19e5044d5d06ba195ab604d8e6a29 100644
9f2ebf
--- a/src/sysv/systemd/sssd-ssh.service.in
9f2ebf
+++ b/src/sysv/systemd/sssd-ssh.service.in
9f2ebf
@@ -9,8 +9,9 @@ RefuseManualStart=true
9f2ebf
 Also=sssd-ssh.socket
9f2ebf
 
9f2ebf
 [Service]
9f2ebf
+Environment=DEBUG_LOGGER=--logger=files
9f2ebf
 ExecStartPre=-/bin/chown @SSSD_USER@:@SSSD_USER@ @logpath@/sssd_ssh.log
9f2ebf
-ExecStart=@libexecdir@/sssd/sssd_ssh --debug-to-files --socket-activated
9f2ebf
+ExecStart=@libexecdir@/sssd/sssd_ssh ${DEBUG_LOGGER} --socket-activated
9f2ebf
 Restart=on-failure
9f2ebf
 User=@SSSD_USER@
9f2ebf
 Group=@SSSD_USER@
9f2ebf
diff --git a/src/sysv/systemd/sssd-sudo.service.in b/src/sysv/systemd/sssd-sudo.service.in
9f2ebf
index b59bcbcd817c3986d7ee245b1083f90ff5a3775a..da022f768af91e360182fad0ff885fad43ecfdc0 100644
9f2ebf
--- a/src/sysv/systemd/sssd-sudo.service.in
9f2ebf
+++ b/src/sysv/systemd/sssd-sudo.service.in
9f2ebf
@@ -9,8 +9,9 @@ RefuseManualStart=true
9f2ebf
 Also=sssd-sudo.socket
9f2ebf
 
9f2ebf
 [Service]
9f2ebf
+Environment=DEBUG_LOGGER=--logger=files
9f2ebf
 ExecStartPre=-/bin/chown @SSSD_USER@:@SSSD_USER@ @logpath@/sssd_sudo.log
9f2ebf
-ExecStart=@libexecdir@/sssd/sssd_sudo --debug-to-files --socket-activated
9f2ebf
+ExecStart=@libexecdir@/sssd/sssd_sudo --socket-activated
9f2ebf
 Restart=on-failure
9f2ebf
 User=@SSSD_USER@
9f2ebf
 Group=@SSSD_USER@
9f2ebf
diff --git a/src/sysv/systemd/sssd.service.in b/src/sysv/systemd/sssd.service.in
9f2ebf
index 05cfd3705084dbff8b46fb07e736612612c58b70..cea848fac80303d6fae12dd84316a91dbc60072d 100644
9f2ebf
--- a/src/sysv/systemd/sssd.service.in
9f2ebf
+++ b/src/sysv/systemd/sssd.service.in
9f2ebf
@@ -5,8 +5,9 @@ Before=systemd-user-sessions.service nss-user-lookup.target
9f2ebf
 Wants=nss-user-lookup.target
9f2ebf
 
9f2ebf
 [Service]
9f2ebf
+Environment=DEBUG_LOGGER=--logger=files
9f2ebf
 EnvironmentFile=-@environment_file@
9f2ebf
-ExecStart=@sbindir@/sssd -i -f
9f2ebf
+ExecStart=@sbindir@/sssd -i ${DEBUG_LOGGER}
9f2ebf
 Type=notify
9f2ebf
 NotifyAccess=main
9f2ebf
 
9f2ebf
-- 
9f2ebf
2.13.5
9f2ebf