Subject: pkg/32204: bacula's postgresql-skripts not owned by pgsql
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <stefan@net-tex.de>
List: pkgsrc-bugs
Date: 11/30/2005 22:41:00
>Number:         32204
>Category:       pkg
>Synopsis:       bacula's postgresql-skripts not owned by pgsql
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 30 22:41:00 +0000 2005
>Originator:     Stefan SCHUMACHER
>Release:        NetBSD 3.0-Beta
>Organization:
>Environment:
NetBSD kaishakunin.homeunix.org 3.0_BETA NetBSD 3.0_BETA (KAISHAKUNIN) #2: Fri Nov  4 22:05:12 CET 2005  stefan@hiwi-ifph.gse.uni-magdeburg.de:/usr/src/obj/sys/arch/i386/compile/KAISHAKUNIN i386

>Description:
pkgsrc/sysutils/bacula installs skripts to setup the required PostgreSQL database. Those skripts (/usr/pkg/libexec/bacula/*postgresql*) are owned by root.wheel and can therefor not be executed by "pgsql".   

PostgreSQL doesn't allow "root" to execute postmaster, so the skripts must be run by "pgsql". "pgsql" cannot access those skripts unless they are chgrp'ed  to "pgsql". 

This is a little bit tricky for sysadmins not that familiar with PostgreSQL user concepts.
>How-To-Repeat:
Install bacula and try to setup the PostgreSQL database with the *postgresql* skripts as "pgsql".
>Fix:
chgrp pgsql /usr/pkg/libexec/bacula/*postgresql*

Another way would be to create the PostgreSQL-database automagically from pkgsrc when installing bacula. Currently "catalog-pgsql" as option is supported, maybe the database creation should be added to the Makefile or at least an option "create-pgsql-database" could be added.