[Bug libc/24913] New: /etc/ld.so.preload.d drop-in configuration folder support

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug libc/24913] New: /etc/ld.so.preload.d drop-in configuration folder support

adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24913

            Bug ID: 24913
           Summary: /etc/ld.so.preload.d drop-in configuration folder
                    support
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: adrelanos at riseup dot net
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

File /etc/ld.so.preload can be used to preload shard objects but there is no
/etc/ld.so.preload.d drop-in configuration folder supported yet.

Modifying /etc/ld.so.preload directly is appropriate for system administrators
but not for linux distributions. A configuration file can only be owned by one
package at the same time. A package that shipped a /etc/ld.so.preload file
might overwrite the local system administator's changes.

Therefore as you may know many applications support configuration drop-in
folders. Examples are /etc/default/grub.d /etc/grub.d /etc/profile.d
/etc/X11/Xsession.d and many more.

Could you please add a new feature to parse /etc/ld.so.preload.d for
configuration snippets?

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/24913] /etc/ld.so.preload.d drop-in configuration folder support

adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24913

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos at redhat dot com

--- Comment #1 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to adrelanos from comment #0)
> File /etc/ld.so.preload can be used to preload shard objects but there is no
> /etc/ld.so.preload.d drop-in configuration folder supported yet.

Yes there is.

You just use "include ld.so.conf.d/*.conf" in the top-level configuration.

> Modifying /etc/ld.so.preload directly is appropriate for system
> administrators but not for linux distributions. A configuration file can
> only be owned by one package at the same time. A package that shipped a
> /etc/ld.so.preload file might overwrite the local system administator's
> changes.

This is not correct.

Distributions can and should modify /etc/ld.so.preload to provide the semantics
they expect, including adding "include ld.so.conf.d/*.conf" at the top of the
configuration file.

System administrators should read their distribution instructions, and on
distributions that use "/etc/ld.so.preload.d" the changes should be made as
files in the configuration directory.

> Therefore as you may know many applications support configuration drop-in
> folders. Examples are /etc/default/grub.d /etc/grub.d /etc/profile.d
> /etc/X11/Xsession.d and many more.

Yes, but we also support that.

We give distributions the flexibility to put this directory anywhere by using
the "include" directive.

> Could you please add a new feature to parse /etc/ld.so.preload.d for
> configuration snippets?

What is missing from the existing support?

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/24913] /etc/ld.so.preload.d drop-in configuration folder support

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24913

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com

--- Comment #2 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Carlos O'Donell from comment #1)
> (In reply to adrelanos from comment #0)
> > File /etc/ld.so.preload can be used to preload shard objects but there is no
> > /etc/ld.so.preload.d drop-in configuration folder supported yet.
>
> Yes there is.
>
> You just use "include ld.so.conf.d/*.conf" in the top-level configuration.

Sorry, /etc/ld.so.conf and /etc/ld.so.preload are two different files with
different parsers and capabilities.  The dynamic loader does not read
/etc/ld.so.conf  at all.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/24913] /etc/ld.so.preload.d drop-in configuration folder support

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24913

--- Comment #3 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Florian Weimer from comment #2)

> (In reply to Carlos O'Donell from comment #1)
> > (In reply to adrelanos from comment #0)
> > > File /etc/ld.so.preload can be used to preload shard objects but there is no
> > > /etc/ld.so.preload.d drop-in configuration folder supported yet.
> >
> > Yes there is.
> >
> > You just use "include ld.so.conf.d/*.conf" in the top-level configuration.
>
> Sorry, /etc/ld.so.conf and /etc/ld.so.preload are two different files with
> different parsers and capabilities.  The dynamic loader does not read
> /etc/ld.so.conf  at all.

Oh! I thought we used exactly the same parser internally for both. I see what
you mean though in elf/rtld.c we have a completely different parser.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/24913] /etc/ld.so.preload.d drop-in configuration folder support

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24913

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-08-19
     Ever confirmed|0                           |1

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/24913] /etc/ld.so.preload.d drop-in configuration folder support

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24913

--- Comment #4 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Carlos O'Donell from comment #3)

> (In reply to Florian Weimer from comment #2)
> > (In reply to Carlos O'Donell from comment #1)
> > > (In reply to adrelanos from comment #0)
> > > > File /etc/ld.so.preload can be used to preload shard objects but there is no
> > > > /etc/ld.so.preload.d drop-in configuration folder supported yet.
> > >
> > > Yes there is.
> > >
> > > You just use "include ld.so.conf.d/*.conf" in the top-level configuration.
> >
> > Sorry, /etc/ld.so.conf and /etc/ld.so.preload are two different files with
> > different parsers and capabilities.  The dynamic loader does not read
> > /etc/ld.so.conf  at all.
>
> Oh! I thought we used exactly the same parser internally for both. I see
> what you mean though in elf/rtld.c we have a completely different parser.

We can probably refactor some of parse_conf_include. I'd hate to have this code
duplicated.

--
You are receiving this mail because:
You are on the CC list for the bug.