Bug 27783

Summary: file-based default DEBUGINFOD_URLS
Product: elfutils Reporter: Frank Ch. Eigler <fche>
Component: debuginfodAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: elfutils-devel, mark
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Frank Ch. Eigler 2021-04-27 18:17:47 UTC
Having a systemwide default DEBUGINFOD_URLS through profiles.d is a bit clumsy in that e.g. system services don't get invoked through a login shell don't get to see it.

So let's instead:

- drop the profile.d files
- add logic to debuginfod-client.c to check for a $configdir/debuginfod_urls file, if the environment variable is unset, as a fallback

Users can still opt out by an override (including to an empty string) of the environment variable.
Comment 1 Frank Ch. Eigler 2021-05-20 02:12:06 UTC
putting idea on ice

prototype patch:
https://sourceware.org/pipermail/elfutils-devel/2021q2/003748.html
Comment 2 Frank Ch. Eigler 2021-06-10 13:28:31 UTC
In the context of fedora https://bugzilla.redhat.com/show_bug.cgi?id=1970312 we should reexamine this.  Here's another idea.

- retain /etc/profile.d/debuginfod* but change its behaviour:
- instead of containing one hardcoded path, let it search a config file/dir
  such as /etc/debuginfod-urls.d/ and assemble the environment variable
- the --with-debuginfod-urls=FOO elfutils option would arrange to drop in one
  file into this directory (say /etc/debuginfod-urls.d/elfutils.url)
  with the content FOO
- other add-on distros (rpmfusion?  ISVs?  local administrator?) can do the same

That way a local admin can remove or update or add more files.  A user can
of course still override it in their .profile.
Comment 3 Mark Wielaard 2021-06-11 11:33:09 UTC
(In reply to Frank Ch. Eigler from comment #2)
> In the context of fedora https://bugzilla.redhat.com/show_bug.cgi?id=1970312
> we should reexamine this.  Here's another idea.
> 
> - retain /etc/profile.d/debuginfod* but change its behaviour:
> - instead of containing one hardcoded path, let it search a config file/dir
>   such as /etc/debuginfod-urls.d/ and assemble the environment variable
> - the --with-debuginfod-urls=FOO elfutils option would arrange to drop in one
>   file into this directory (say /etc/debuginfod-urls.d/elfutils.url)
>   with the content FOO
> - other add-on distros (rpmfusion?  ISVs?  local administrator?) can do the
> same
> 
> That way a local admin can remove or update or add more files.  A user can
> of course still override it in their .profile.

I like doing this through /etc/profile.d/debuginfod* much more than doing this in debuginfod-client.c
Comment 4 Frank Ch. Eigler 2021-10-07 19:08:21 UTC
commit a83fe488a7b422fc8260bdb35526d39a195c624a
Author: Frank Ch. Eigler <fche@redhat.com>
Date:   Sun Oct 3 17:04:24 2021 -0400

    PR27783: switch default debuginfod-urls to drop-in style files
    
    Rewrote and commented the /etc/profile.d csh and sh script fragments
    to take the default $DEBUGINFOD_URLS from the union of drop-in files:
    /etc/debuginfod/*.urls.  Hand-tested with csh and bash, with
    conditions including no prior $DEBUGINFOD_URLS, nonexistent .urls
    files, multiple entries in .urls files.
    
    Signed-off-by: Frank Ch. Eigler <fche@redhat.com>