Subject: pkg/18249: Inappropriate permissions on PGDATA after pgsql install (postgresql)
To: None <>
From: None <>
List: netbsd-bugs
Date: 09/10/2002 17:30:28
>Number:         18249
>Category:       pkg
>Synopsis:       Inappropriate permissions on PGDATA after pgsql install (postgresql)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 10 00:32:00 PDT 2002
>Release:        NetBSD 1.6E
System: NetBSD elysium 1.6E NetBSD 1.6E (elysium) #0: Tue Aug 6 07:29:42 EST 2002 rtr@elysium:/wasabi/home/source/co/retry/src/sys/arch/i386/compile/elysium i386
Architecture: i386
Machine: i386
	postgresql's pkgsrc rc.d script initdb fails with permission denied
	when it attempts to create PGDATA directory.

	It occurs because the PGDATA must be owned by non-root user and as such
	the script just attempts to create the directory with that non-root
	user whom does not have permission to do so.

-- output -- 
	elysium# /etc/rc.d/pgsql initdb
	Initializing PostgreSQL databases.
	The files belonging to this database system will be owned by user "pgsql".
	This user must also own the server process.

	creating directory /usr/pkg/pgsql/data... mkdir: /usr/pkg/pgsql/data: Permission denied

	initdb failed.
-- end --

	Install pkgsrc postgresql
	/etc/rc.d/pgsql initdb
	Either create (default) /usr/pkg/pgsql/data w/ root and chown it to
	the new pgsql user or allow pgsql user to create in /usr/pkg/pgsql

Very simple to fix.