Where to have my .so files install?

Mel fbsd.questions at rachie.is-a-geek.net
Sat Apr 19 09:21:32 UTC 2008

On Saturday 19 April 2008 02:47:28 cpghost wrote:
> On Fri, 18 Apr 2008 20:24:09 -0400
> "Aryeh M. Friedman" <aryeh.friedman at gmail.com> wrote:
> > Adam J Richardson wrote:
> > > Hi all.
> > >
> > > I'm writing a program which uses .so files as plugins. Now I need
> > > to decide where on the filesystem to install the plugins. I don't
> > > want to clutter the system locations like /lib and /usr/lib. Can
> > > anyone suggest a decent install location? Google doesn't help much
> > > with this.
> > >
> > > TiA,
> > > Adam J Richardson
> >
> > /usr/local/lib
> To expand a bit: don't put your own stuff in /lib or /usr/lib,
> since this is used by FreeBSD's userland itself. On FreeBSD,
> third party stuff goes into /usr/local/{lib,bin,etc,...}.
> See hier(7).

I actually put my own stuff in /opt, which follows /usr/local layout, because 
ports use /usr/local and I don't want to risk some port installing over or 
deleting (part of) my apps.
It's easy to set up:
mkdir /opt
mtree -ude -f /etc/mtree/BSD.local.dist -p /opt

Add /opt/bin, /opt/sbin to path in /etc/login.conf.
Add /opt/man to OPTIONAL_MANPATH in /etc/manpath.config
Add a MANPATH_MAP in there too.
Delete the users' .profile line that overrides the PATH variable (I really 
wish they'd take that outof the skel).
Add /opt/etc/rc.d to local_startup in /etc/rc.conf
Add /opt/lib to ldconfig_paths in /etc/rc.conf

Problem with today's modular software: they start with the modules
    and never get to the software part.

More information about the freebsd-questions mailing list