rc.d/ldconfig change

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

rc.d/ldconfig change

Florent Thoumie
        Since we have some ports that want to ldconfig directories early
        in the boot process (actually, early in localpkg sequence), I
        think it would be a good idee to support
        ${PREFIX}/etc/ld.so.conf.d/ directories (or whatever the name).

        Here's what I was thinking about (see attached patch).

        This way, I can imagine a USE_LDCONFIG variable containing
        directories and bsd.port.mk would just :

        .if defined(USE_LDCONFIG)
        echo ${USE_LDCONFIG} > ${PREFIX}/etc/ld.so.conf.d/${UNIQUENAME}
        .endif

        [...] instead of installing 000.${UNIQUENAME}.sh in
        ${PREFIX}/etc/rc.d.

        I guess it should be ok since /etc/rc.d/ldconfig is launched
        after /etc/rc.d/mountcritremote. We can assume that local
        directories will be available (by default local_ldconfig="").

        Note: That's a simple patch to src/etc/rc.d/ldconfig, I'll work
        on a more polished one (with updated configuration).

--
Florent Thoumie
[hidden email]
FreeBSD committer

ldconfig.diff (902 bytes) Download Attachment
signature.asc (194 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rc.d/ldconfig change

Brooks Davis
On Sun, Dec 18, 2005 at 06:31:20PM +0100, Florent Thoumie wrote:

> Since we have some ports that want to ldconfig directories early
> in the boot process (actually, early in localpkg sequence), I
> think it would be a good idee to support
> ${PREFIX}/etc/ld.so.conf.d/ directories (or whatever the name).
>
> Here's what I was thinking about (see attached patch).
>
> This way, I can imagine a USE_LDCONFIG variable containing
> directories and bsd.port.mk would just :
>
> .if defined(USE_LDCONFIG)
> echo ${USE_LDCONFIG} > ${PREFIX}/etc/ld.so.conf.d/${UNIQUENAME}
> .endif
>
> [...] instead of installing 000.${UNIQUENAME}.sh in
> ${PREFIX}/etc/rc.d.
>
> I guess it should be ok since /etc/rc.d/ldconfig is launched
> after /etc/rc.d/mountcritremote. We can assume that local
> directories will be available (by default local_ldconfig="").
Sounds good to me.  I'd been thinking we could use something like
this since all those scripts are ugly.  This nice thing about this
is that we could use a compatibility port that just installs a
000.ldconfig-compat.sh script to shim old versions to allow the hack
script to die in ports almost immediately.

-- Brooks

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rc.d/ldconfig change

Florent Thoumie
On Mon, 2005-12-19 at 12:33 -0800, Brooks Davis wrote:

> On Sun, Dec 18, 2005 at 06:31:20PM +0100, Florent Thoumie wrote:
> > Since we have some ports that want to ldconfig directories early
> > in the boot process (actually, early in localpkg sequence), I
> > think it would be a good idee to support
> > ${PREFIX}/etc/ld.so.conf.d/ directories (or whatever the name).
> >
> > Here's what I was thinking about (see attached patch).
> >
> > This way, I can imagine a USE_LDCONFIG variable containing
> > directories and bsd.port.mk would just :
> >
> > .if defined(USE_LDCONFIG)
> > echo ${USE_LDCONFIG} > ${PREFIX}/etc/ld.so.conf.d/${UNIQUENAME}
> > .endif
> >
> > [...] instead of installing 000.${UNIQUENAME}.sh in
> > ${PREFIX}/etc/rc.d.
> >
> > I guess it should be ok since /etc/rc.d/ldconfig is launched
> > after /etc/rc.d/mountcritremote. We can assume that local
> > directories will be available (by default local_ldconfig="").
>
> Sounds good to me.  I'd been thinking we could use something like
> this since all those scripts are ugly.  This nice thing about this
> is that we could use a compatibility port that just installs a
> 000.ldconfig-compat.sh script to shim old versions to allow the hack
> script to die in ports almost immediately.
        Yes, that's the idea.

--
Florent Thoumie
[hidden email]
FreeBSD committer

signature.asc (194 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rc.d/ldconfig change

Florent Thoumie
In reply to this post by Brooks Davis
On Mon, 2005-12-19 at 12:33 -0800, Brooks Davis wrote:

> On Sun, Dec 18, 2005 at 06:31:20PM +0100, Florent Thoumie wrote:
> > Since we have some ports that want to ldconfig directories early
> > in the boot process (actually, early in localpkg sequence), I
> > think it would be a good idee to support
> > ${PREFIX}/etc/ld.so.conf.d/ directories (or whatever the name).
> >
> > Here's what I was thinking about (see attached patch).
> >
> > This way, I can imagine a USE_LDCONFIG variable containing
> > directories and bsd.port.mk would just :
> >
> > .if defined(USE_LDCONFIG)
> > echo ${USE_LDCONFIG} > ${PREFIX}/etc/ld.so.conf.d/${UNIQUENAME}
> > .endif
> >
> > [...] instead of installing 000.${UNIQUENAME}.sh in
> > ${PREFIX}/etc/rc.d.
> >
> > I guess it should be ok since /etc/rc.d/ldconfig is launched
> > after /etc/rc.d/mountcritremote. We can assume that local
> > directories will be available (by default local_ldconfig="").
>
> Sounds good to me.  I'd been thinking we could use something like
> this since all those scripts are ugly.  This nice thing about this
> is that we could use a compatibility port that just installs a
> 000.ldconfig-compat.sh script to shim old versions to allow the hack
> script to die in ports almost immediately.
        Here's the (almost) complete patch. I'll take care of the ports
        part once we get this in the tree.

        I finally set local_ldconfig to "/usr/local/etc/ld.so.conf.d
        /usr/X11R6/etc/ld.so.conf.d" because we already have
        local_startup and local_periodic (in etc/defaults/periodic.conf)
        using such directories (and that's one thing less the user has
        to do).

        I've added an entry in the local mtree file and bumped
        __FreeBSD_version.

        Someone could argue the directory's name (ld.so.conf.d), I
        really don't care, I figured it was simple enough so that anyone
        would know what it is for.

--
Florent Thoumie
[hidden email]
FreeBSD committer

ldconfig.diff (4K) Download Attachment
signature.asc (194 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rc.d/ldconfig change

Yar Tikhiy-2
On Tue, Dec 20, 2005 at 01:21:53AM +0100, Florent Thoumie wrote:

> Index: share/man/man5/rc.conf.5
> ===================================================================
> RCS file: /home/ncvs/src/share/man/man5/rc.conf.5,v
> retrieving revision 1.274
> diff -u -r1.274 rc.conf.5
> --- share/man/man5/rc.conf.5 19 Dec 2005 10:57:00 -0000 1.274
> +++ share/man/man5/rc.conf.5 20 Dec 2005 00:18:22 -0000
> @@ -2822,6 +2822,13 @@
>  Set this variable to
>  .Dq Li YES
>  to disable that security check during system startup.
> +.It Va local_ldconfig
> +.Pq Vt str
> +Set to the list of local
> +.Xr ldconfig 8
> +directories.
> +Each file in those directories will be passed as arguments to
> +.Xr ldconfig 8 .

What do you think about the following, slightly different wording?

        The names of all files in the directories listed
        will be passed as arguments to
        .Xr ldconfig 8 .

This should fix the singular vs. plural usage and also tell the
sweet truth that there will be a single run of ldconfig(8) irrespective
of the number of the files.

--
Yar
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-rc
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: rc.d/ldconfig change

Florent Thoumie
On Tue, 2005-12-20 at 20:25 +0300, Yar Tikhiy wrote:

> On Tue, Dec 20, 2005 at 01:21:53AM +0100, Florent Thoumie wrote:
> > Index: share/man/man5/rc.conf.5
> > ===================================================================
> > RCS file: /home/ncvs/src/share/man/man5/rc.conf.5,v
> > retrieving revision 1.274
> > diff -u -r1.274 rc.conf.5
> > --- share/man/man5/rc.conf.5 19 Dec 2005 10:57:00 -0000 1.274
> > +++ share/man/man5/rc.conf.5 20 Dec 2005 00:18:22 -0000
> > @@ -2822,6 +2822,13 @@
> >  Set this variable to
> >  .Dq Li YES
> >  to disable that security check during system startup.
> > +.It Va local_ldconfig
> > +.Pq Vt str
> > +Set to the list of local
> > +.Xr ldconfig 8
> > +directories.
> > +Each file in those directories will be passed as arguments to
> > +.Xr ldconfig 8 .
>
> What do you think about the following, slightly different wording?
>
> The names of all files in the directories listed
> will be passed as arguments to
> .Xr ldconfig 8 .
>
> This should fix the singular vs. plural usage and also tell the
> sweet truth that there will be a single run of ldconfig(8) irrespective
> of the number of the files.
        Sounds ok to me.

        Anything else ?

--
Florent Thoumie
[hidden email]
FreeBSD committer

signature.asc (194 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rc.d/ldconfig change

dougb
In reply to this post by Florent Thoumie
Florent Thoumie wrote:
> Since we have some ports that want to ldconfig directories early
> in the boot process (actually, early in localpkg sequence), I
> think it would be a good idee to support
> ${PREFIX}/etc/ld.so.conf.d/ directories (or whatever the name).

I'd rather keep it out of etc/ for fear that users might think it's a knob
they can twiddle. I would suggest PREFIX/libdata (note, pkgconfig stuff is
already there, so this may not be the best choice, but it fits with
precedent). Whatever name you choose, it will need an entry in
/etc/mtree/BSD.local.dist.

> Here's what I was thinking about (see attached patch).
>
> This way, I can imagine a USE_LDCONFIG variable containing
> directories and bsd.port.mk would just :
>
> .if defined(USE_LDCONFIG)
> echo ${USE_LDCONFIG} > ${PREFIX}/etc/ld.so.conf.d/${UNIQUENAME}
> .endif

I would use touch here, but I won't quibble.

> [...] instead of installing 000.${UNIQUENAME}.sh in
> ${PREFIX}/etc/rc.d.
>
> I guess it should be ok since /etc/rc.d/ldconfig is launched
> after /etc/rc.d/mountcritremote. We can assume that local
> directories will be available (by default local_ldconfig="").
>
> Note: That's a simple patch to src/etc/rc.d/ldconfig, I'll work
> on a more polished one (with updated configuration).
>
>
>
> ------------------------------------------------------------------------
>
> Index: rc.d/ldconfig
> ===================================================================
> RCS file: /home/ncvs/src/etc/rc.d/ldconfig,v
> retrieving revision 1.14
> diff -u -r1.14 ldconfig
> --- rc.d/ldconfig 16 Jan 2005 08:34:30 -0000 1.14
> +++ rc.d/ldconfig 18 Dec 2005 17:18:28 -0000
> @@ -22,6 +22,11 @@
>   checkyesno ldconfig_insecure && _ins="-i"
>   if [ -x "${ldconfig_command}" ]; then
>   _LDC="/lib /usr/lib"
> + for i in ${local_ldconfig}; do

Please make the variable name ldconfig_local_d (or _dir if you prefer, just
try to keep it short), as the convention is that all variables relative to a
given rc.d script need to start with the name of the script. I assume from
what you wrote above that you are going to do the /etc/defaults/rc.conf and
rc.conf(5) updates as well?

Thanks for this creative thinking, I think that this change will go a long
way towards making things easier for our users.

Doug

--

     This .signature sanitized for your protection

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-rc
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: rc.d/ldconfig change

Florent Thoumie
On Wednesday 28 December 2005 03:02, Doug Barton wrote:

> Florent Thoumie wrote:
> > Since we have some ports that want to ldconfig directories early
> > in the boot process (actually, early in localpkg sequence), I
> > think it would be a good idee to support
> > ${PREFIX}/etc/ld.so.conf.d/ directories (or whatever the name).
>
> I'd rather keep it out of etc/ for fear that users might think it's a knob
> they can twiddle. I would suggest PREFIX/libdata (note, pkgconfig stuff is
> already there, so this may not be the best choice, but it fits with
> precedent). Whatever name you choose, it will need an entry in
> /etc/mtree/BSD.local.dist.
        I don't much care about where it's stored, I figured out that etc/ was a good
        candidate because /etc/ had already ld.so.conf but libdata is fine with me.

        Note that I modified BSD.local.dist in latest version of the patch.

> > Here's what I was thinking about (see attached patch).
> >
> > This way, I can imagine a USE_LDCONFIG variable containing
> > directories and bsd.port.mk would just :
> >
> > .if defined(USE_LDCONFIG)
> > echo ${USE_LDCONFIG} > ${PREFIX}/etc/ld.so.conf.d/${UNIQUENAME}
> > .endif
>
> I would use touch here, but I won't quibble.
        Not sure how you could do the same thing with only touch.

> > [...] instead of installing 000.${UNIQUENAME}.sh in
> > ${PREFIX}/etc/rc.d.
> >
> > I guess it should be ok since /etc/rc.d/ldconfig is launched
> > after /etc/rc.d/mountcritremote. We can assume that local
> > directories will be available (by default local_ldconfig="").
> >
> > Note: That's a simple patch to src/etc/rc.d/ldconfig, I'll work
> > on a more polished one (with updated configuration).
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > Index: rc.d/ldconfig
> > ===================================================================
> > RCS file: /home/ncvs/src/etc/rc.d/ldconfig,v
> > retrieving revision 1.14
> > diff -u -r1.14 ldconfig
> > --- rc.d/ldconfig 16 Jan 2005 08:34:30 -0000 1.14
> > +++ rc.d/ldconfig 18 Dec 2005 17:18:28 -0000
> > @@ -22,6 +22,11 @@
> >   checkyesno ldconfig_insecure && _ins="-i"
> >   if [ -x "${ldconfig_command}" ]; then
> >   _LDC="/lib /usr/lib"
> > + for i in ${local_ldconfig}; do
>
> Please make the variable name ldconfig_local_d (or _dir if you prefer, just
> try to keep it short), as the convention is that all variables relative to
> a given rc.d script need to start with the name of the script. I assume
> from what you wrote above that you are going to do the
> /etc/defaults/rc.conf and rc.conf(5) updates as well?
        Already done in the latest version of the patch, but these changes are ok for
        me. Since it's going to be set by default to a sensible value, I guess the
        name doesn't matter.

> Thanks for this creative thinking, I think that this change will go a long
> way towards making things easier for our users.

        That's the point ;)

--
Florent Thoumie
[hidden email]
FreeBSD Committer

attachment0 (194 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rc.d/ldconfig change

dougb
Florent Thoumie wrote:

> I don't much care about where it's stored, I figured out that etc/ was a
> good candidate because /etc/ had already ld.so.conf but libdata is fine
> with me.

Ok, let's go with that unless someone else has a better idea.

> Note that I modified BSD.local.dist in latest version of the patch.

I did after I finished reading the thread. :) Good catch.

>>> Here's what I was thinking about (see attached patch).
>>>
>>> This way, I can imagine a USE_LDCONFIG variable containing
>>> directories and bsd.port.mk would just :
>>>
>>> .if defined(USE_LDCONFIG) echo ${USE_LDCONFIG} >
>>> ${PREFIX}/etc/ld.so.conf.d/${UNIQUENAME} .endif
>> I would use touch here, but I won't quibble.
>
> Not sure how you could do the same thing with only touch.

Ok, I think I'm confused about one part of the patch or another then. It
seems from your rc.d/ldconfig patch that all you are looking at are the
names of the files in the ldconfig_local_d directories, but it occurs to me
now that just the names won't really help, you actually need to store the
paths to feed to ldconfig somewhere, which I presume is what you were going
to include in the USE_LDCONFIG variable. Am I right so far? If so, then I
don't understand how your patch to rc.d/ldconfig is going to work, but I may
be missing something. :)


Doug

--

     This .signature sanitized for your protection

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-rc
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: rc.d/ldconfig change

Florent Thoumie
On Thursday 29 December 2005 01:36, Doug Barton wrote:

> Florent Thoumie wrote:
> > I don't much care about where it's stored, I figured out that etc/ was a
> > good candidate because /etc/ had already ld.so.conf but libdata is fine
> > with me.
>
> Ok, let's go with that unless someone else has a better idea.
>
> > Note that I modified BSD.local.dist in latest version of the patch.
>
> I did after I finished reading the thread. :) Good catch.
>
> >>> Here's what I was thinking about (see attached patch).
> >>>
> >>> This way, I can imagine a USE_LDCONFIG variable containing
> >>> directories and bsd.port.mk would just :
> >>>
> >>> .if defined(USE_LDCONFIG) echo ${USE_LDCONFIG} >
> >>> ${PREFIX}/etc/ld.so.conf.d/${UNIQUENAME} .endif
> >>
> >> I would use touch here, but I won't quibble.
> >
> > Not sure how you could do the same thing with only touch.
>
> Ok, I think I'm confused about one part of the patch or another then. It
> seems from your rc.d/ldconfig patch that all you are looking at are the
> names of the files in the ldconfig_local_d directories, but it occurs to me
> now that just the names won't really help, you actually need to store the
> paths to feed to ldconfig somewhere, which I presume is what you were going
> to include in the USE_LDCONFIG variable. Am I right so far? If so, then I
> don't understand how your patch to rc.d/ldconfig is going to work, but I
> may be missing something. :)
        Hum, I'm actually using paths stored in files located in ld.so.conf.d/
        directories.

        For example, you could have :

        # cat /usr/local/libdata/ld.so.conf.d/compat4x
        /usr/local/lib/compat
        #

--
Florent Thoumie
[hidden email]
FreeBSD Committer

attachment0 (194 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rc.d/ldconfig change

dougb
Florent Thoumie wrote:

> Hum, I'm actually using paths stored in files located in ld.so.conf.d/
> directories.
>
> For example, you could have :
>
> # cat /usr/local/libdata/ld.so.conf.d/compat4x
> /usr/local/lib/compat

Ok, I think I'll understand this better when I see a complete example
implementation. Sorry for being so dense. :)

Doug

--

     This .signature sanitized for your protection

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-rc
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: rc.d/ldconfig change

Florent Thoumie
On Thursday 29 December 2005 07:45, Doug Barton wrote:

> Florent Thoumie wrote:
> > Hum, I'm actually using paths stored in files located in ld.so.conf.d/
> > directories.
> >
> > For example, you could have :
> >
> > # cat /usr/local/libdata/ld.so.conf.d/compat4x
> > /usr/local/lib/compat
>
> Ok, I think I'll understand this better when I see a complete example
> implementation. Sorry for being so dense. :)
        No problem, here is the new patch. I'm working on the ports part right now.

        You'll notice that I've turned my `ls ${i}` into `find ${i} -type f` which
        does the right thing. Also, I've had a look at the scripts your compatiblity
        ports are installing and since there's a special handling on amd64, I've
        added some lines to rc.d/ldconfig. I haven't found a way to do what I wanted
        without duplicating ldconfig_local_dirs and ld.so.conf.d directories. Maybe
        you'll be more creative than I am.

--
Florent Thoumie
[hidden email]
FreeBSD Committer

attachment0 (194 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rc.d/ldconfig change

Florent Thoumie
On Thursday 29 December 2005 13:30, Florent Thoumie wrote:

> On Thursday 29 December 2005 07:45, Doug Barton wrote:
> > Florent Thoumie wrote:
> > > Hum, I'm actually using paths stored in files located in ld.so.conf.d/
> > > directories.
> > >
> > > For example, you could have :
> > >
> > > # cat /usr/local/libdata/ld.so.conf.d/compat4x
> > > /usr/local/lib/compat
> >
> > Ok, I think I'll understand this better when I see a complete example
> > implementation. Sorry for being so dense. :)
>
> No problem, here is the new patch. I'm working on the ports part right
> now.
>
> You'll notice that I've turned my `ls ${i}` into `find ${i} -type f` which
> does the right thing. Also, I've had a look at the scripts your
> compatiblity ports are installing and since there's a special handling on
> amd64, I've added some lines to rc.d/ldconfig. I haven't found a way to do
> what I wanted without duplicating ldconfig_local_dirs and ld.so.conf.d
> directories. Maybe you'll be more creative than I am.
        I think I forgot the most important thing, attaching the patch.

        I've put it here :

        http://people.freebsd.org/~flz/local/ldconfig.diff

        I've changed libdata/ld.so.conf.d/ to libdata/ldconfig. I guess it's ok now.

--
Florent Thoumie
[hidden email]
FreeBSD Committer

attachment0 (194 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rc.d/ldconfig change

dougb
Florent Thoumie wrote:

> On Thursday 29 December 2005 13:30, Florent Thoumie wrote:
>> On Thursday 29 December 2005 07:45, Doug Barton wrote:
>>> Florent Thoumie wrote:
>>>> Hum, I'm actually using paths stored in files located in ld.so.conf.d/
>>>> directories.
>>>>
>>>> For example, you could have :
>>>>
>>>> # cat /usr/local/libdata/ld.so.conf.d/compat4x
>>>> /usr/local/lib/compat
>>> Ok, I think I'll understand this better when I see a complete example
>>> implementation. Sorry for being so dense. :)
>> No problem, here is the new patch. I'm working on the ports part right
>> now.
>>
>> You'll notice that I've turned my `ls ${i}` into `find ${i} -type f` which
>> does the right thing. Also, I've had a look at the scripts your
>> compatiblity ports are installing and since there's a special handling on
>> amd64, I've added some lines to rc.d/ldconfig. I haven't found a way to do
>> what I wanted without duplicating ldconfig_local_dirs and ld.so.conf.d
>> directories. Maybe you'll be more creative than I am.
>
> I think I forgot the most important thing, attaching the patch.

You attached the patch, but the list stripped it. I just committed your code
with 3 minor modifications. 1. I added the ldconfig directories to
BSD.x11.dist as well as BSD.local.dist. 2. I had to change the
ldconfig32_local_dirs variable name. The rc.d system requires all variables
for a given name to be name_foo. 3. s/32-bits/32-bit/.

I also just committed an update to misc/compat[45]x to use this new
mechanism. I know that you have plans for developing this in bsd.port.mk,
but as we discussed I think it's useful to start exercising this mechanism,
and it works great. :)

Thanks again for coming up with this very creative solution.

Doug

--

     This .signature sanitized for your protection

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-rc
To unsubscribe, send any mail to "[hidden email]"