tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Home directory of PostgreSQL user

On Sat, Jul 19, 2014 at 09:32:36AM -0400, Greg Troxel wrote:
> > why does "PGHOME", the location of the home directory of the PostgreSQL 
> > user,
> > default to "${PREFIX}/${PGUSER}"? "${VARBASE}/${PGUSER}" would be a much
> > better choice. And if that directory is really required why does the
> > package not create it?
> I think it's mostly historical.

That was my first guess. :-)

> But it's slightly awkward to change, because upgrades from before to
> after have to cope.

That could be scripted if we wanted to.

> /var is often a smallish filesystem,

Is it?

> df -h
Filesystem         Size       Used      Avail %Cap Mounted on
/dev/ld0a          122M       111M       5.0M  95% /
/dev/ld0e           19G        12G       6.7G  63% /var
/dev/ld0f          9.6G       6.2G       2.9G  68% /usr
/dev/ld0g           77G        26G        48G  34% /home
/dev/ld0h           96G       7.5G        84G   8% /archiv
tmpfs              192M       416K       192M   0% /tmp
procfs             4.0K       4.0K         0B 100% /proc
kernfs             1.0K       1.0K         0B 100% /kern
ptyfs              1.0K       1.0K         0B 100% /dev/pts

I've made "/var" larger than e.g. "/usr" on any kinds of server for
years. E-Mail, log files and a lot of other stuff require tons
of diskspace.

> ... at least for those who practice traditional Unix separate filesystems.

The traditional UNIX filesystem separation is an artificat of the past
that IMHO only gets in the way. My own server install has root,
"/var" and "/usr" on the same largish file-system.

> Real databases, as opposed to
> auxiliary data that is needed to run a system, really don't belong in
> /var,

I disagree. "/var" is hystorically for system data. And that is what
database tablesa are.

> /usr/pkg/pgsql seems as good a place as any as a default and
> works for casual use.

I disagree. "/usr" is for software installation. And you should be
abel to mount it read-only.

> Another thought is that pgsql db doesn't really belong in var under
> hier(7), but as "user data" someplace.   Otherwise, why are user home
> directories not under /var?

Because their *user* data and not *system* data.

> I think all in all this is really arguing for VARBASE not being /var,
> but /usr/pkg/var - I think it's in general a bug for pkgsrc to put
> anything other than under /usr/pkg,

I disagree strongly which is I've set "PKG_SYSCONFBASE" to "/etc/pkg"
on my NetBSD system. A friend of mine use these settings under Solaris:

LOCALBASE=              /opt/pkg
PKG_SYSCONFBASE=        /etc/opt/pkg
VARBASE=                /var/pkg

It keeps "pkgsrc" separate from the rest but in the conceptionally right
place. The default should probably be something like the above.

> /etc/rc.d/pgsql will create the directory when the server is started.

Thanks. I noticed that in the meantime.

        Kind regards

Matthias Scheler                       

Home | Main Index | Thread Index | Old Index