Re: Having problem with postgresql configuration (template1 doesn't exist)?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vinicius <cviniciusm(at)terra(dot)com(dot)br>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Having problem with postgresql configuration (template1 doesn't exist)?
Date: 2005-02-20 17:48:36
Message-ID: 15094.1108921716@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Vinicius <cviniciusm(at)terra(dot)com(dot)br> writes:
> postgres$ initdb -D /usr/local/pgsql/data"

> the file /var/log/messages shows:
> "Feb 20 02:01:38 ronin kernel: audit(1108875698.227:0): avc: denied {
> write } for pid=8229 exe=/usr/bin/postgres name=data
> dev=dm-0 ino=1687533 scontext=user_u:system_r:postgresql_t
> tcontext=root:object_r:usr_t tclass=dir

You can't put the data directory in a nonstandard place under SELinux
unless you modify the security policy to allow the postgres daemon to
write in that nonstandard place. The normal behavior of
selinux-policy-targeted is to confine postgres to /var/lib/pgsql.

So: (1) use /var/lib/pgsql/data, (2) modify the policy, or (3)
disable SELinux enforcement.

BTW, since you are using the RPMs, why are you bothering with manual
database setup? "sudo /sbin/service postgresql start" is all you
need to do.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Vinicius 2005-02-20 19:05:11 Re: Having problem with postgresql configuration (template1 doesn't
Previous Message Vinicius 2005-02-20 13:11:40 Having problem with postgresql configuration (template1 doesn't exist)?