Subject: pkg/18249: Inappropriate permissions on PGDATA after pgsql install (postgresql)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <Tyler.Retzlaff@elysium.netbsd.org>
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
>Closed-Date:
>Last-Modified:
>Originator:     rtr@wasabisystems.com
>Release:        NetBSD 1.6E
>Organization:
	None
>Environment:
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
>Description:
	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 --


>How-To-Repeat:
	Install pkgsrc postgresql
	/etc/rc.d/pgsql initdb
>Fix:
	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.
>Release-Note:
>Audit-Trail:
>Unformatted: