Subject: Re: /var/db/pkg
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Robert Elz <kre@munnari.OZ.AU>
List: current-users
Date: 05/24/2000 18:20:33
    Date:        Tue, 23 May 2000 18:01:37 +0200
    From:        Manuel Bouyer <bouyer@antioche.lip6.fr>
    Message-ID:  <20000523180137.B357@antioche.lip6.fr>

  | I disagree. /etc is where up-to-date files are stored, this is what's
  | important.

yes, it is, but if you do

	dump ... /

or
	cp /etc/{files,that,matter} /var/backups
	dump ... /var

then surely all that matters is saved just the same, except there are
several advantages.  (Or you can use some other directory in /var,
I have used /var/save sometimes) if you perfer to leave the standard
NetBSD usage of /var/backups unaltered.

First, should one of the important files be lost, it is just left sitting
there in /var just the same as it is on the tape, which can make it much
quicker to recover.   Second, more useful stuff gets dumped (most of the
rest of the dump of / just duplicates the distribution, and isn't really
important, essentially nothing in /var is of that nature), and third, if
you need to do a full restore, then you can't really start with a full
restore of / - you need / to exist in order to do the restores.  It is
generally easier to re-install in that case (perhaps even upgrade) and
then restore /var and copy back the files that matter.

  | /var/mail is only on mail servers,

Not true.   If you use fetchmail, or even procmail, your mail (or some
of it) can end up in /var/mail even on your local workstation.

  | If you're backuping once a day, /var/spool/mqueue and /var/db/dhcpd.leases
  | will be out of date anyway and are not that usefull.

mqueue varies - though recovering it is generally better than trashing it
if at all possible (some messages can wait in the queue for days before being
delivered).   For dhcp.leases, unless you have a very high churn rate, it
will always be much better to recover it.   In most cases (where there are
enough addresses available for the clients), even an out of date leases
file is much better than none at all.  The dhcp server will hand out the
same address again to a client that requests it, even if the lease had
expired (or the server thought it had because of an old leases file being
restored), which is just what you want to happen.

  | On a system where /var matters I'd rather go with a raid filesystem than
  | backups.

Sure, mirroring (or raid 5 or whatever) /var is a good idea for continuous
uptime - but that is no substitute at all for dumps.  No raid I have ever
seen will recover you from a major machine room fire...

  | Conforming to hier is also important I think:
  | /var/      multi-purpose log, temporary, transient, and spool files

hier is a description of what is where, it isn't, and shouldn't be,
treated as a specification of what must be put where.

  | /var/db/pkg doens't fit in this category.

Nor is /var/at, yet hier(7) (the 1.4.2 version anyway) says that
goes in /var ...  It does with /var/msgs as well.  Then there's
also /var/spool/ftp.

I think the one line summary of /var is a poor one, it is an attempt to
describe what is a general mish-mash really by example, which is a very
poor way to accomplish anything useful.

I'd prefer if hier(7) said

	/var/	system maintained files that are subject to change
		(including spool, log, database, and longer term
		temporary files)

But in any case, please can we all stop treating hier as a bible,
as if it were the true word handed down from above, which is never
subject to challenge.

kre