Subject: Re: pgsql's home
To: None <tech-pkg@netbsd.org>
From: Louis Guillaume <lguillaume@berklee.edu>
List: tech-pkg
Date: 04/16/2007 16:58:30
Johnny C. Lam wrote:
> Geert Hendrickx wrote:
>> I personally put it under ${VARBASE}/db, usually.
> 
> hier(7) on NetBSD says:
> 
> /var/    multi-purpose log, temporary, transient, and spool files
> 
> That doesn't sound at all like what a database should be.

I understand that there has been a lot of discussion in the past
regarding what goes where and hier(7) is supposed to have at least some
of the answers.

But hier(7) doesn't explicitly cover where things like databases and web
sites should go. Maybe that should change.

I'm curious regarding the history of /var. Doesn't "var" stand for
"variable", or "things that change"? In which case database data would
be included?

> I picked
> ${PREFIX} because that's the only place that pkgsrc really "owns" and
> controls.  In any case, it's usually irrelevant... the pgsql rc.d script
> always uses the home directory that's set in /etc/passwd for the
> location of the database.

I don't want pkgsrc to "own" or control the data, just the packaged
software and configuration files. That's why I want the location to be
outside of ${PREFIX}.

Installing pgsql's home directory under ${PREFIX} is exactly in line
with their documentation (defaults to /usr/local/pgsql), since
/usr/local is the default for the --prefix configuration option.

But many admins (myself included) don't like to keep databases or things
like web servers in the ${PREFIX}. This way, I can cleanly remove my
whole /usr/pkg directory if things for some reason went awry with the
pkgsrc installation.

Many packages use /var for data files: mysql, openldap, subversion,
spamassassin; to name a few that I use.

For this reason I would prefer to keep pgsql's home in /var and hence my
suggestion in the patch. That's not to say it's the answer for pkgsrc,
just the obvious choice for me.

Perhaps this can be configurable in mk.conf.

Hmm, it dawns on me now that I might be able to add
"PGHOME=${VARBASE}/${PGUSER}" in mk.conf. If this works I'm happy.

Another suggestion related to your comment on the rc.d script: perhaps a
MESSAGE to tell the installer that they could "usermod -d
/preferred/path pgsql" if they wanted to change the location of the data
files.

Thanks,

Louis