Re: Postmaster hangs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Karen Pease <meme(at)daughtersoftiresias(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Postmaster hangs
Date: 2009-10-26 13:52:32
Message-ID: 19919.1256565152@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Karen Pease <meme(at)daughtersoftiresias(dot)org> writes:
> Postgres is by default in /var/lib/pgsql. When / started running out of
> space, I moved it to /scratch and symlinked:
> lrwxrwxrwx 1 root root 15 2009-09-11 16:57 pgsql
> -> /scratch/pgsql//

Hmm, that could be a problem right there. Do you have SELinux running?
It will normally try to prevent the postmaster from accessing files
outside /var/lib/pgsql. Depending on how you moved the files, they
might have had the right security labels anyway, but I suspect some of
your symptoms might have to do with some files under /scratch/pgsql
not having the right labels. Try poking around with ls -lZ. If you
find some that have generic labels, you can fix them manually with
chcon, but a better long-term solution would be to teach selinux
that stuff under /scratch/pgsql should be treated the same as stuff
under /var/lib/pgsql would be --- that way a stray restorecon won't
mess up your work. Last I heard, the relevant policy rules are

/var/lib/pgsql/data(/.*)? gen_context(system_u:object_r:postgresql_db_t,s0)
/var/lib/pgsql/logfile(/.*)? gen_context(system_u:object_r:postgresql_log_t,s0)
/var/lib/pgsql/pgstartup\.log gen_context(system_u:object_r:postgresql_log_t,s0)

Unfortunately I don't know selinux well enough to know where to
add custom rules :-(, but a bit of manual-reading ought to tell you.

If it's *not* a permissions issue, then I would expect postgres to
be logging something relevant ... have you checked into the log
files?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dimitri Fontaine 2009-10-26 17:19:00 Re: BUG #5137: Upgrade policy clarification
Previous Message Craig Ringer 2009-10-26 12:27:02 Re: Postmaster hangs