Re: PATCH: PR27783: debuginfod: fetch default DEBUGINFOD_URLS from systemwide file

2021-05-03 Thread Mark Wielaard
Hi Frank,

On Thu, 2021-04-29 at 12:13 -0400, Frank Ch. Eigler via Elfutils-devel
wrote:
> This change was suggested by fedora fesco folks, to make it easier
> for for auxiliary system daemons to use debuginfod by default.
> 
> commit 4db2eba32aaed7d567f5ebea6b2eb7a6dc4b4b36
> Author: Frank Ch. Eigler 
> Date:   Thu Apr 29 11:49:14 2021 -0400
> 
> PR27783 debuginfod: fetch default DEBUGINFOD_URLS from systemwide file
> 
> Introduce use of a systemwide config file /etc/debuginfod_urls for a
> fallback default for an unset $DEBUGINFOD_URLS.  $DEBUGINFOD_URLS_FILE
> overrides the default location of that file, which is probably mainly
> useful for testing.  Deprecate the similar /etc/profile.d/debuginfod*
> mechanism that affected only login shells.
> 
> OTOH, setting ANY of the following to be an empty string will disable
> debuginfod-client capability:
> - env var $DEBUGINFOD_URLS
> - env var $DEBUGINFOD_URLS_FILE
> - the file named by $DEBUGINFOD_URLS_FILE

So this replaces the profile environment settings with a system-wide
config file. Which isn't really the same thing. Like you said it would
also enable debuginfod in settings that don't have the DEBUGINFOD_URLS
environment variable set, like system daemons. But I think that is the
nice things about using the environment variable to indicate
debuginfod-client should be used in a specific environment. If a daemon
does want to use debuginfod-client it must set the environment variable
explicitly.  systemd provides a simple way to set environment
variables, either through Environment or EnvironmentFile:
http://0pointer.de/public/systemd-man/systemd.exec.html#Environment=

Personally I think it would be better to make enablement of debuginfod-
client specific for different environment (using it by default in a
system daemon is different from running it standard in a login shell).

Also some distros already seem to rely on the profile files, so
removing them now seems like a bad idea.

Cheers,

Mark


Re: PATCH: PR27783: debuginfod: fetch default DEBUGINFOD_URLS from systemwide file

2021-05-03 Thread Frank Ch. Eigler via Elfutils-devel
Hi -

> [...] But I think that is the nice things about using the
> environment variable to indicate debuginfod-client should be used in
> a specific environment. [...]

This is only a way of making the default more of an opt-out than an
opt-in, and put it into a -single- systemwide spot (instead of two
profile.* files plus all the opt-in systemd unit files).  A daemon
-disinterested- in participating could set the same env var to be an
empty string.

> Also some distros already seem to rely on the profile files, so
> removing them now seems like a bad idea.

Well, nothing stops them from continuing to ship the same files, they
don't need to come from elfutils upstream.

Anyway all that said, I'm neutral on this change.  Any other opinions?

- FChE



Re: PATCH: PR27784 debuginfod: notify interactive clients one time about usage

2021-05-03 Thread Mark Wielaard
Hi Frank,

On Thu, 2021-04-29 at 14:44 -0400, Frank Ch. Eigler via Elfutils-devel
wrote:
> Another request from fedora fesco.  (I don't have anything else on
> the queue for the next elfutils release.)
> 
> commit be5ebebb1f12134b673c5b8cbede62390d077b0d
> Author: Frank Ch. Eigler 
> Date:   Thu Apr 29 14:34:06 2021 -0400
> 
> PR27784 debuginfod: notify interactive clients one time about usage
> 
> Because debuginfod-client functionality makes a user dependent on the
> correct operation of remote debuginfod server, it was suggested that
> new users be notified of this.  This patch adds a one-time
> notification to stderr if it isatty(), commemorated by a new cache
> notify_p file.  (It cannot easily be tested because our test scripts
> run without pty/tty enclosure.)

I cannot say I am a fan of the library being the one to do this check,
especially not with the sleep (3) in it. It also is not really
accurate, it only shows the debuginfod server URLs the first time they
are set, not when they are changed. I would hide this behind
DEBUGINFOD_VERBOSE=1 but that already shows the URLs anyway.

If there is such a "notification" then it should be from the actual
application using the library IMHO. Or when installing a profile if it
provides default DEBUGINFOD_URLS.

Cheers,

Mark


Re: PATCH: PR27784 debuginfod: notify interactive clients one time about usage

2021-05-03 Thread Frank Ch. Eigler via Elfutils-devel
Hi -


> I cannot say I am a fan of the library being the one to do this check,
> especially not with the sleep (3) in it. 

It's a clumsy compromise, yes, but it is a one-time thing that only
humans should see, and only once.

> It also is not really accurate, it only shows the debuginfod server
> URLs the first time they are set, not when they are changed. [...]

Would you find it more palatable if it were to compare previous and
current $DEBUGINFOD_URLS (say, written into that notify_p file)?

> If there is such a "notification" then it should be from the actual
> application using the library IMHO. 

That would be a dozen+ separate applications.

> Or when installing a profile if it provides default DEBUGINFOD_URLS.

Like at "rpm -i"?  Those times are by design not chatty, and not
visible to the right people anyway.


- FChE