Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 May 2020 19:41:18 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Ottavio Caruso <ottavio2006-usenet2012@yahoo.com>
Cc:        malaizhichun@tom.com, freebsd-questions@freebsd.org
Subject:   Re: On a serious note, what I'd change about FreeBSD hier(7)
Message-ID:  <20200506194118.1135658d.freebsd@edvax.de>
In-Reply-To: <CAEJNuHyB66K16JHFPcabfyoWoNT=GGFjFJ0wfqpDB27CYidnzA@mail.gmail.com>
References:  <83788746a7d8a802d8af4b582e00827166febd1a.camel@tom.com> <20200506172115.cb3b572b.freebsd@edvax.de> <CAEJNuHyB66K16JHFPcabfyoWoNT=GGFjFJ0wfqpDB27CYidnzA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 6 May 2020 18:21:59 +0100, Ottavio Caruso wrote:
> On Wed, 6 May 2020 at 16:21, Polytropon <freebsd@edvax.de> wrote:
> >
> > FreeBSD's general organisation keeps all non-OS stuff stored
> > in /usr/local; the directories owned by the OS have a specific
> > purpose which is reflected by their name and location
> 
> 
> I'd pretty much want to have all non-base stuff into somewhere else
> than /usr/local. I like NetBSD installing ports in /usr/pkg (or
> whenever you want set your $PREFIX to). I'd rather have /usr/local for
> my own personal software and avoid it messing up with official ports.

That exactly is what lots of people use /opt for. Historically
coming from Solaris, it is used to install software that is not
maintained by pkg (which defaults to /usr/local). There are
several approaches of how /opt should be laid out, and in fact,
you can usually combine them. One is to have /opt contain a set
of subtrees like /usr/local; another one is to have subdirectories
for every custom program, which is either called from its location,
or via symlink into /opt/bin which is then set to be in $PATH.

Personally, I often have something like this:

	/opt/bin	-> user scripts and symlinks
	/opt/libexec	-> scripts like print filters
	/opt/src	-> local sources
	/opt/<name>	-> local software installs

There are several /opt/<name> directories, and they do not have
much in common: in some, there's a bin/, in others a program/, and
in others nothing (the binary is in /opt/<name>, symlinked to
/opt/bin if it should be called without full path). If I should
need /opt/etc, I would probably add it, but for the few cases I
have encountered so far, the programs kept their configuration
inside their /opt/<name>, and it was not human-serviceable.

This is of course only one out of many possibilities... ;-)

The /usr/local, beneath /usr, suggests that the ports (!) installed
there have a certain relationship to the OS. This is true. They
are maintained via pkg, their presence, dependencies and versions
are recorded in databases of the OS.

But /opt typically is entirely out of scope, so much that you
can actually use a different name for it. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200506194118.1135658d.freebsd>