Skip to content

Commit

Permalink
SYSTEMD: Replace parameter --debug-to-files with ${DEBUG_LOGGER}
Browse files Browse the repository at this point in the history
Users can set variable DEBUG_LOGGER in environment files
(/etc/sysconfig/sssd or /etc/default/sssd; depending on the distribution)
to override default logging to files.

e.g.
DEBUG_LOGGER=--logger=stderr
DEBUG_LOGGER=--logger=journald

Resolves:
https://pagure.io/SSSD/sssd/issue/3433

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
  • Loading branch information
Lukas Slebodnik committed Nov 3, 2017
1 parent cb75b27 commit a7277fe
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 32 deletions.
12 changes: 1 addition & 11 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ sssdkcmdatadir = $(datadir)/sssd-kcm
deskprofilepath = $(sss_statedir)/deskprofile

if HAVE_SYSTEMD_UNIT
ifp_exec_cmd = $(sssdlibexecdir)/sssd_ifp --uid 0 --gid 0 --debug-to-files --dbus-activated
ifp_exec_cmd = $(sssdlibexecdir)/sssd_ifp --uid 0 --gid 0 --dbus-activated
ifp_systemdservice = SystemdService=sssd-ifp.service
ifp_restart = Restart=on-failure
else
Expand Down Expand Up @@ -4483,10 +4483,6 @@ if BUILD_KCM
src/sysv/systemd/sssd-kcm.service \
$(NULL)
endif
if WITH_JOURNALD
systemdconf_DATA += \
src/sysv/systemd/journal.conf
endif
else
if HAVE_SUSE
init_SCRIPTS += \
Expand Down Expand Up @@ -4535,7 +4531,6 @@ replace_script = \

EXTRA_DIST += \
src/sysv/systemd/sssd.service.in \
src/sysv/systemd/journal.conf.in \
src/sysv/systemd/sssd-nss.socket.in \
src/sysv/systemd/sssd-nss.service.in \
src/sysv/systemd/sssd-pam.socket.in \
Expand Down Expand Up @@ -4585,10 +4580,6 @@ src/sysv/systemd/sssd.service: src/sysv/systemd/sssd.service.in Makefile
@$(MKDIR_P) src/sysv/systemd/
$(replace_script)

src/sysv/systemd/journal.conf: src/sysv/systemd/journal.conf.in Makefile
@$(MKDIR_P) src/sysv/systemd/
$(replace_script)

src/sysv/systemd/sssd-nss.socket: src/sysv/systemd/sssd-nss.socket.in Makefile
@$(MKDIR_P) src/sysv/systemd/
$(replace_script)
Expand Down Expand Up @@ -4924,7 +4915,6 @@ endif
rm -f $(builddir)/src/sysv/systemd/sssd-secrets.service
rm -f $(builddir)/src/sysv/systemd/sssd-kcm.socket
rm -f $(builddir)/src/sysv/systemd/sssd-kcm.service
rm -f $(builddir)/src/sysv/systemd/journal.conf
rm -f $(builddir)/src/tools/wrappers/sss_debuglevel

CLEANFILES += *.X */*.X */*/*.X
Expand Down
4 changes: 0 additions & 4 deletions contrib/sssd.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -971,10 +971,6 @@ done
%attr(711,sssd,sssd) %dir %{_sysconfdir}/sssd
%attr(711,sssd,sssd) %dir %{_sysconfdir}/sssd/conf.d
%ghost %attr(0600,sssd,sssd) %config(noreplace) %{_sysconfdir}/sssd/sssd.conf
%if (0%{?use_systemd} == 1)
%attr(755,root,root) %dir %{_sysconfdir}/systemd/system/sssd.service.d
%config(noreplace) %{_sysconfdir}/systemd/system/sssd.service.d/journal.conf
%endif
%dir %{_sysconfdir}/logrotate.d
%config(noreplace) %{_sysconfdir}/logrotate.d/sssd
%dir %{_sysconfdir}/rwtab.d
Expand Down
7 changes: 0 additions & 7 deletions src/sysv/systemd/journal.conf.in

This file was deleted.

3 changes: 2 additions & 1 deletion src/sysv/systemd/sssd-autofs.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ RefuseManualStart=true
Also=sssd-autofs.socket

[Service]
Environment=DEBUG_LOGGER=--logger=files
ExecStartPre=-/bin/chown @SSSD_USER@:@SSSD_USER@ @logpath@/sssd_autofs.log
ExecStart=@libexecdir@/sssd/sssd_autofs --debug-to-files --socket-activated
ExecStart=@libexecdir@/sssd/sssd_autofs ${DEBUG_LOGGER} --socket-activated
Restart=on-failure
User=@SSSD_USER@
Group=@SSSD_USER@
Expand Down
3 changes: 2 additions & 1 deletion src/sysv/systemd/sssd-ifp.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ After=sssd.service
BindsTo=sssd.service

[Service]
Environment=DEBUG_LOGGER=--logger=files
Type=dbus
BusName=org.freedesktop.sssd.infopipe
ExecStart=@ifp_exec_cmd@
ExecStart=@ifp_exec_cmd@ ${DEBUG_LOGGER}
@ifp_restart@
3 changes: 2 additions & 1 deletion src/sysv/systemd/sssd-kcm.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ Documentation=man:sssd-kcm(5)
Also=sssd-kcm.socket

[Service]
ExecStart=@libexecdir@/sssd/sssd_kcm --uid 0 --gid 0 --debug-to-files
Environment=DEBUG_LOGGER=--logger=files
ExecStart=@libexecdir@/sssd/sssd_kcm --uid 0 --gid 0 ${DEBUG_LOGGER}
3 changes: 2 additions & 1 deletion src/sysv/systemd/sssd-nss.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ RefuseManualStart=true
Also=sssd-nss.socket

[Service]
ExecStart=@libexecdir@/sssd/sssd_nss --debug-to-files --socket-activated
Environment=DEBUG_LOGGER=--logger=files
ExecStart=@libexecdir@/sssd/sssd_nss ${DEBUG_LOGGER} --socket-activated
Restart=on-failure
3 changes: 2 additions & 1 deletion src/sysv/systemd/sssd-pac.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ RefuseManualStart=true
Also=sssd-pac.socket

[Service]
Environment=DEBUG_LOGGER=--logger=files
ExecStartPre=-/bin/chown @SSSD_USER@:@SSSD_USER@ @logpath@/sssd_pac.log
ExecStart=@libexecdir@/sssd/sssd_pac --debug-to-files --socket-activated
ExecStart=@libexecdir@/sssd/sssd_pac ${DEBUG_LOGGER} --socket-activated
Restart=on-failure
User=@SSSD_USER@
Group=@SSSD_USER@
Expand Down
3 changes: 2 additions & 1 deletion src/sysv/systemd/sssd-pam.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ RefuseManualStart=true
Also=sssd-pam.socket sssd-pam-priv.socket

[Service]
Environment=DEBUG_LOGGER=--logger=files
ExecStartPre=-/bin/chown @SSSD_USER@:@SSSD_USER@ @logpath@/sssd_pam.log
ExecStart=@libexecdir@/sssd/sssd_pam --debug-to-files --socket-activated
ExecStart=@libexecdir@/sssd/sssd_pam ${DEBUG_LOGGER} --socket-activated
Restart=on-failure
User=@SSSD_USER@
Group=@SSSD_USER@
Expand Down
3 changes: 2 additions & 1 deletion src/sysv/systemd/sssd-secrets.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ Documentation=man:sssd-secrets(5)
Also=sssd-secrets.socket

[Service]
ExecStart=@libexecdir@/sssd/sssd_secrets --uid 0 --gid 0 --debug-to-files
Environment=DEBUG_LOGGER=--logger=files
ExecStart=@libexecdir@/sssd/sssd_secrets --uid 0 --gid 0 ${DEBUG_LOGGER}
3 changes: 2 additions & 1 deletion src/sysv/systemd/sssd-ssh.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ RefuseManualStart=true
Also=sssd-ssh.socket

[Service]
Environment=DEBUG_LOGGER=--logger=files
ExecStartPre=-/bin/chown @SSSD_USER@:@SSSD_USER@ @logpath@/sssd_ssh.log
ExecStart=@libexecdir@/sssd/sssd_ssh --debug-to-files --socket-activated
ExecStart=@libexecdir@/sssd/sssd_ssh ${DEBUG_LOGGER} --socket-activated
Restart=on-failure
User=@SSSD_USER@
Group=@SSSD_USER@
Expand Down
3 changes: 2 additions & 1 deletion src/sysv/systemd/sssd-sudo.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ RefuseManualStart=true
Also=sssd-sudo.socket

[Service]
Environment=DEBUG_LOGGER=--logger=files
ExecStartPre=-/bin/chown @SSSD_USER@:@SSSD_USER@ @logpath@/sssd_sudo.log
ExecStart=@libexecdir@/sssd/sssd_sudo --debug-to-files --socket-activated
ExecStart=@libexecdir@/sssd/sssd_sudo --socket-activated
Restart=on-failure
User=@SSSD_USER@
Group=@SSSD_USER@
Expand Down
3 changes: 2 additions & 1 deletion src/sysv/systemd/sssd.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Before=systemd-user-sessions.service nss-user-lookup.target
Wants=nss-user-lookup.target

[Service]
Environment=DEBUG_LOGGER=--logger=files
EnvironmentFile=-@environment_file@
ExecStart=@sbindir@/sssd -i -f
ExecStart=@sbindir@/sssd -i ${DEBUG_LOGGER}
Type=notify
NotifyAccess=main

Expand Down

0 comments on commit a7277fe

Please sign in to comment.