Re: Postmaster hangs - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Postmaster hangs
Date
Msg-id 19919.1256565152@sss.pgh.pa.us
Whole thread Raw
In response to Re: Postmaster hangs  (Karen Pease <meme@daughtersoftiresias.org>)
Responses Re: Postmaster hangs
List pgsql-bugs
Karen Pease <meme@daughtersoftiresias.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

pgsql-bugs by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Postmaster hangs
Next
From: Dimitri Fontaine
Date:
Subject: Re: BUG #5137: Upgrade policy clarification