pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/38725: pgsql_home is ignored by rc.d/pgsql when started from /etc/rc



>Number:         38725
>Category:       pkg
>Synopsis:       pgsql_home is ignored by rc.d/pgsql when started from /etc/rc
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 22 09:50:00 +0000 2008
>Originator:     Mike M. Volokhov
>Release:        OS with rc.d support + pkgsrc-current
>Organization:
        The NetBSD Project
>Environment:
System: NetBSD nostromo.od5.lohika.com 4.99.55 NetBSD 4.99.55 (GENERIC) #0: Mon 
Mar 10 13:57:25 EET 2008 
mishka%nostromo.od3.lohika.com@localhost:/build/ab/obj-i386-20080310/sys/arch/i386/compile/GENERIC
 i386
Architecture: i386
Machine: i386
>Description:

        databases/postgresql8*-server packages are containing pgsql
        control script suitable for NetBSD rc.d system. Accordingly
        to the script pgsql_flags and pgsql_home variables can be
        used in /etc/rc.conf to adjust a PostgreSQL installation.

        rc.d/pgsql presets variables and lets them overriden by
        loading /etc/rc.conf on later stage.  Values from rc.conf
        are loaded in usual for rc.d manner - by performing
        "load_rc_config $name" call. Unfortunately, when it called
        during /etc/rc execution the load_rc_conf() from pgsql will
        not override default values set by rc.d/pgsql, just because
        /etc/rc.conf was already loaded.

>How-To-Repeat:
        
        1. Set pgsql_home variable in /etc/rc.conf
        2. Restart OS or execute the following commands (as per /etc/rc):
                # . /etc/rc.subr
                # . /etc/rc.conf
                # _rc_conf_loaded=true
                # rc.d/pgsql start

>Fix:

        I'd suggest the following patch common for all
        postgresql8*-server packages:

--- pgsql.sh    9 Dec 2006 15:34:40 -0000       1.1.1.1
+++ pgsql.sh    22 May 2008 08:22:13 -0000
@@ -29,7 +29,7 @@
 rcvar=$name
 pgsql_user="@PGUSER@"
 pgsql_group="@PGGROUP@"
-eval pgsql_home="~$pgsql_user"
+eval pgsql_home=${pgsql_home:-"~$pgsql_user"}
 
 command="@PG_PREFIX@/bin/postmaster"
 ctl_command="@PG_PREFIX@/bin/pg_ctl"



Home | Main Index | Thread Index | Old Index