[sf-perl] poll: directory layout question

Michael Paoli Michael.Paoli at cal.berkeley.edu
Sat Apr 24 23:29:06 PDT 2010

I'd be inclined to start here:

I'd typically put the variable bits under /var,
/var/opt - for 3rd party applications variable content
/var/local - locally installed stuff not matching the above or  
immediately below
/var - elsewhere under var for OS/distribution packages

Configuration bits under /etc, e.g. likewise:
/etc/local, /etc, /etc/opt

Static bits would generally be under /usr, e.g.
or /opt for 3rd party stuff.

Typically, precedence-wise:
/usr /var /etc /opt - with /opt functioning similar to /usr, but for 3rd
party stuff, then, if applicable, subdirectory of opt or local - except
no /opt/opt or /opt/local, then typically package name (or for 3rd party,
often vendor_name/package_name) when under /opt or /var or /usr/local,
but many things may go, or also go more directly into suitable
directories, e.g. /usr/local/bin/name_of_app_executable.  These can be
versioned with symbolic links to preferred/default version.

Anyway, that's where I'd generally put things physically.  Symbolic
links can also be used to aid in logical

Standards/conventions will vary depending upon environment, e.g. the
above would mostly apply to POSIX/SUS/Unix/Linux/BSD, but not as much so
for Microsoft, VM, MVS, etc.

"Of course" it all should be reasonably configurable (e.g. with suitable
build/install options), and packaged appropriately (distribution/flavor
packaging and/or CPAN).  Things may also change, e.g. from "local" to
not in a given distribution if that something becomes package provided
by that distribution.

> Date: Thu, 22 Apr 2010 09:54:43 -0700
> From: David Alban <extasia at extasia.org>
> Subject: [sf-perl] poll: directory layout question
> To: sfperl <sanfrancisco-pm at pm.org>
> Message-ID:
> 	<t2l4c714a9c1004220954r7fc30d16uc8fa6dd8b76c15bb at mail.gmail.com>
> say you're developing "tool 1.0".
> say tool has some config files you want in an etc directory and some
> state files you want in a lib directory.  say you want tool under
> </usr/local/>.
> do you prefer this layout:
>      /usr/local/etc/tool/...
>      /usr/local/lib/tool/...
> or this layout:
>      /usr/local/tool/etc/...
>      /usr/local/tool/lib/...
> and why?
> i know both work.  i've used both.  but i'm curious as to the reasons
> you fine folks choose one over the other.

More information about the SanFrancisco-pm mailing list