standard locations for port files
Bob Eager
rde at tavi.co.uk
Thu Aug 31 20:19:47 UTC 2017
On Thu, 31 Aug 2017 15:54:09 -0400
<scratch65535 at att.net> wrote:
> [Default] On Thu, 31 Aug 2017 13:53:27 -0500, Adam Vande More
> <amvandemore at gmail.com> wrote:
>
> >On Thu, Aug 31, 2017 at 1:41 PM, <scratch65535 at att.net> wrote:
> >
> >> Why wouldn't logs be in /usr/local/var/...? Given that all
> >> other port "stuff" is under /usr/local, what advantage is there
> >> in making logs an exception?
> >>
> >
> >Because logs shouldn't be under /usr.
>
> Why not? The current location wasn't determined by natural law,
> it was just someone's decision, almost certainly made without
> much thought at all. It could be re-decided just as easily.
The current hierarchy has had a lot of thought put into it. Files
in /usr generally don't constantly change (although if /home is
symlinked to /usr/home they might, I guess. Files in /var *do* change a
lot, hence its name. It's also the reason that the root file system is
separate; if it isn't written to much, it's less likely to sustain
damage.
/var is designed for files that *change* - that's why logs go there. If
you want to, by all means create /var/local and put your logs there.
A compelling reason, already mentioned, is that there are a lot of
systems that have /usr mounted read only (e.g. net booted systems, or
those that are booted from a USB stick). Such systems usually put /var
in a RAM disk, so that logs can be kept. Even if /var is on an actual
disk, it means that other parts of the file system can be kept read
only. This improves reliability and integrity, and makes recovery after
a crash a lot quicker.
All in all, /var is the *right* place.
More information about the freebsd-ports
mailing list