[Pkg-postgresql-public] Bug#739276: postgresql: Put pgstat in /var/run

Christoph Berg myon at debian.org
Sat Mar 8 19:08:03 UTC 2014


Re: Christian Tacke 2014-03-08 <20140308115643.GA20470 at Ahorn.local.lan>
> > /var/run/lock wouldn't work because it's too small (5120k here).
> 
> stats_temp_directory files are often quite small. My small
> cluster has a 58 kB pgstat.stat. So this could work.

It'll easily grow to a handfull of megabytes if you create more
tables.


Re: Martin Pitt 2014-03-08 <20140308165306.GA2902 at piware.de>
> > Note that pg_ctlcluster creates the stats_temp_directory
> > and sets the owner of that directory to the cluster owner.
> > So for clusters that root/postgres created but hands over
> > to other people, this should actually work. (Not tested!)
> 
> Yes, as long as the init scripts (which run as root) do that, the init
> script could pre-create the stats dir (the patch doesn't currently do
> that, though). It would still not work to run pg_ctlcluster start as
> the cluster owner, though.

We do create the stats dir, but obviously that won't work if
pg_ctlcluster isn't running as root and the user can't write to the
parent dir.

> > /tmp is possibly still better than the data directory.
> 
> Yes, indeed. Especially on machines with a reasonable amount of
> memory it is advisable to put /tmp/ on a tmpfs, and I guess many
> people do that (reduces battery usage, HD
> wakeups/wearout/fragmentation, and on servers to increase
> performance).

I don't think we should put stuff into /tmp by default even if mkdir()
is safe.

> > # Clusters created by normal users will need to change this
> > # option in postgresql.conf, because the directory will not
> > # be setup properly for them.
> 
> No, I don't believe in configuring broken defaults. Then let's rather
> only configure this for owners which can actually write
> /var/run/postgres/, so that the status quo is kept for clusters of
> other owners.

Right. I wouldn't want to put too much magic in createcluster.conf,
but "don't set this var if the dir isn't writable" is a good plan.

Christoph
-- 
cb at df7cb.de | http://www.df7cb.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-postgresql-public/attachments/20140308/5a0c63f4/attachment.sig>


More information about the Pkg-postgresql-public mailing list