On Tue, 15 Feb 2005 rwhart@mchsi.com wrote:
> Hi all,
> I am installing 8.0.1 on FC3. The initial installatin went well. I am now
> trying to change and use a different directory /pg_data. I have established and
> exportede PGDATA and it is /pg_data. I have mkdir /pg_data and changed the
> owner to postgres and run chmod with 700 on the directory. Whenever it log in as
> user postgres and run initdb I get the output of the attached file.
> Does anyone have any ideas? AFAIK I have follwed the docs.
>
> Thanks,
>
> Bob Hartung
Are you running SElinux with the targeted policy, in enforced mode?
I think this is FC3 default. Check /var/log/messages for audit errors.
You need to modify your policy if you want PostgreSQL (or any other
daemons affected by the targeted policy, that is most of them) to be able
to access data in non standard directories. I've been through it, it's not
that hard. Alternatively, you may run SElinux in permissive mode or
disable it entirely. See /etc/sysconfig/selinux (there's also a GUI tool
to set SElinux behaviour but I always forget its name). Please note
that disabling SElinux affects the security of _all_ daemons.
As a quick test, you may run:
# setenforce 0
and then launch the initdb. Watch for audit errors in messages.
BTE, has anyone tried with:
setsebool postgresql_disable_trans=0 ?
Unluckily, I don't have a test host at hand at the moment. Maybe
in the targeted policy that's enough to disable controls on PostgreSQL,
while leaving other daemons confined. I'm not sure, tho, I'm just getting
started with SElinux.
.TM.
--
____/ ____/ /
/ / / Marco Colombo
___/ ___ / / Technical Manager
/ / / ESI s.r.l.
_____/ _____/ _/ Colombo@ESI.it