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.
putting idea on ice prototype patch: https://sourceware.org/pipermail/elfutils-devel/2021q2/003748.html
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.
(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
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>