Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A set of patches to sanitize logger code a little bit. #5535

Closed
wants to merge 12 commits into from

Conversation

alexey-tikhonov
Copy link
Member

@alexey-tikhonov alexey-tikhonov commented Mar 12, 2021

Most significant changes are:

  • getting rid of 'debug-to-files', 'debug-to-stderr' command line options and undocumented 'debug_to_files' sssd.conf option
    and
  • getting sss_set_logger() and open_debug_file() incorporated into DEBUG_INIT API

This PR also resolves: #5488

defined in debug.c from util.h to debug.h
This patch gets rid of:
 - 'debug-to-files', 'debug-to-stderr' command line options
 - undocumented 'debug_to_files' sssd.conf option
and makes '--logger' command line option the only "source of truth" for
logger type configuration.

Those options were not used much anyway but made precedence logic obscure
in case contradictory settings were used.

:config: Long time deprecated and undocumented 'debug_to_files' option was
removed.

:relnote: 'debug-to-files', 'debug-to-stderr' command line and undocumented
'debug_to_files' config options were removed.
This makes code less error-prone reducing amount of function calls required
for debug initialization.
and moved rarely used / "private" functions to the bottom.
since is it is only used in tests.
This makes code less error-prone reducing amount of function calls required
for debug initialization.
@thalman
Copy link
Contributor

thalman commented Mar 24, 2021

I went trough the patches, looks good to me. I will run few tests before acking.

Thanks
Tom

@thalman
Copy link
Contributor

thalman commented Mar 31, 2021

Just for the record: Testing on my fedora shows that the patch as is prevents sssd to log into files in our current setup.
We discussed it on IRC and @alexey-tikhonov will send an update later.

Thanks
Tom

@alexey-tikhonov
Copy link
Member Author

Thanks. Updated.

@thalman
Copy link
Contributor

thalman commented Mar 31, 2021

Thanks for the patch
ACK

@pbrezina pbrezina added the Ready to push Ready to push label Apr 1, 2021
@pbrezina
Copy link
Member

pbrezina commented Apr 1, 2021

Pushed PR: #5535

  • master
    • 66960c7 - MONITOR: in case '-i' is given don't force logger to 'stderr' if its value specified explictly
    • 0cddb67 - DEBUG: introduce SSSDBG_TOOLS_DEFAULT
    • 21334de - MONITOR: added logging of cmd used to start services
    • dde57f7 - DEBUG: incorporate open_debug_file() into DEBUG_INIT
    • 374d644 - Moved SSSDBG_MASK_ALL out of debug.h since is it is only used in tests.
    • cf69917 - DEBUG: added several comments to debug.h API and moved rarely used / "private" functions to the bottom.
    • 4d133e1 - DEBUG: remove sss_set_logger() from public API
    • c14e439 - DEBUG: incorporate sss_set_logger() into DEBUG_INIT
    • fc5b64e - DEBUG: make use of existing SSSD_DEBUG_OPTS macro
    • fee3883 - DEBUG: use '--logger' as the only option to configure logger type.
    • 0dfb188 - Moved declaration of debug related helpers defined in debug.c from util.h to debug.h
    • 0fd0681 - Moved ldb_debug_messages() out of UTILS to SYSDB

@pbrezina pbrezina added Pushed and removed Accepted Ready to push Ready to push labels Apr 1, 2021
@pbrezina pbrezina closed this Apr 1, 2021
@joakim-tjernlund
Copy link
Contributor

This PR forgot to change -f in src/sysv/gentoo/sssd.in so sssd now fails to start as -f option is not recognized.
Please replace -f with --logger=files

@alexey-tikhonov
Copy link
Member Author

This PR forgot to change -f in src/sysv/gentoo/sssd.in so sssd now fails to start as -f option is not recognized.
Please replace -f with --logger=files

@joakim-tjernlund , do we really need distribution-specific config in upstream repo?

@scabrero , do you use https://github.com/SSSD/sssd/blob/master/src/sysv/SUSE/sssd.in somehow?

@joakim-tjernlund
Copy link
Contributor

This PR forgot to change -f in src/sysv/gentoo/sssd.in so sssd now fails to start as -f option is not recognized.
Please replace -f with --logger=files

@joakim-tjernlund , do we really need distribution-specific config in upstream repo?

@scabrero , do you use https://github.com/SSSD/sssd/blob/master/src/sysv/SUSE/sssd.in somehow?

Hi, I don't think we need dist. specific ones but there are variables in there that needs processing.
Also, Gentoo vs. SUSE, the Gentoo one is openrc while SUSE is a plain script so you cannot merge them into one.

@joakim-tjernlund
Copy link
Contributor

To be clear, you could have a generic openrc script and a generic SYSV shell script

@alexey-tikhonov
Copy link
Member Author

Hi, I don't think we need dist. specific ones but there are variables in there that needs processing.

Is this file really used in Gentoo?
There are:
https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-auth/sssd/files/sssd.service
https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-auth/sssd/files/sssd

But I'm really not familiar with Gentoo packaging thus asking.

To be clear, you could have a generic openrc script and a generic SYSV shell script

Yes, this makes sense.

@joakim-tjernlund
Copy link
Contributor

Hi, I don't think we need dist. specific ones but there are variables in there that needs processing.

Is this file really used in Gentoo?
There are:
https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-auth/sssd/files/sssd.service
https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-auth/sssd/files/sssd

But I'm really not familiar with Gentoo packaging thus asking.

Yes, you can choose systemd or openrc at build time(Gentoo is a source based dist so every SW pkg are built locally)
The sssd.service is just used in old 2.2.0. Same for sssd file.

@alexey-tikhonov
Copy link
Member Author

Ok, so probably we could rename sysv/gentoo/sssd.in to sysv/openrc/sssd.in and get rid of sysv/SUSE/ (merge to sysv/sssd.in)...

@scabrero
Copy link
Contributor

scabrero commented Apr 6, 2021

@scabrero , do you use https://github.com/SSSD/sssd/blob/master/src/sysv/SUSE/sssd.in somehow?

No we don't use it. We are using src/sysv/systemd/*.

alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this pull request Apr 6, 2021
@alexey-tikhonov
Copy link
Member Author

#5569

alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this pull request Apr 6, 2021
pbrezina pushed a commit that referenced this pull request Apr 13, 2021
see #5535 (comment)

Reviewed-by: Pavel Březina <pbrezina@redhat.com>
akuster pushed a commit to akuster/sssd that referenced this pull request May 18, 2021
see SSSD#5535 (comment)

Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected (?) side effect of SSSDBG_DEFAULT change
5 participants