On a serious note, what I'd change about FreeBSD hier(7)

Polytropon freebsd at edvax.de
Wed May 6 17:41:32 UTC 2020


On Wed, 6 May 2020 18:21:59 +0100, Ottavio Caruso wrote:
> On Wed, 6 May 2020 at 16:21, Polytropon <freebsd at 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, ...


More information about the freebsd-questions mailing list