X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 209D68BAFB3 for ; Sun, 20 Feb 2005 17:48:43 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 37539-08 for ; Sun, 20 Feb 2005 17:48:38 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id EB3508BAFAD for ; Sun, 20 Feb 2005 17:48:38 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j1KHmadu015095; Sun, 20 Feb 2005 12:48:37 -0500 (EST) To: Vinicius Cc: pgsql-admin@postgresql.org Subject: Re: Having problem with postgresql configuration (template1 doesn't exist)? In-reply-to: References: Comments: In-reply-to Vinicius message dated "Sun, 20 Feb 2005 10:11:40 -0300" Date: Sun, 20 Feb 2005 12:48:36 -0500 Message-ID: <15094.1108921716@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/176 X-Sequence-Number: 16344 Vinicius 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