If one sets PG_EXTRA_ENV in /etc/conf.d/postgresql-8.2 , then the init script fails due to the fact that the argument passed to start-stop-server (which is: --env "PGPORT=${whatever} ${PG_EXTRA_ENV}" ) expects everything after the = to be assigned to PGPORT. The options specified in PG_EXTRA_ENV need to be split up and each have their own individual --env parameter. The following adjustment will work: --- /etc/init.d/postgresql-8.2.old +++ /etc/init.d/postgresql-8.2 @@ -85,10 +85,12 @@ rm -f ${DATA_DIR}/postmaster.pid local retval + local pgenvopts=$(echo $PG_EXTRA_ENV |sed -e 's/\([A-Z][^=]*\)=/--env \1=/g') start-stop-daemon --start \ --user postgres \ --exec /usr/lib/postgresql-8.2/bin/postgres \ - --env "PGPORT=${configured_port} ${PG_EXTRA_ENV}" \ + --env PGPORT=${configured_port} \ + ${pgenvopts} \ --wait $((${START_TIMEOUT}*1000)) \ --pidfile ${DATA_DIR}/postmaster.pid \ Reproducible: Always
Seems to me a for loop does the same thing with less work. 25 Dec 2011; Aaron W. Swenson <titanofold@gentoo.org> +postgresql-server-8.2.23-r1.ebuild, +postgresql-server-8.3.17-r1.ebuild, +postgresql-server-8.4.10-r1.ebuild, +postgresql-server-9.0.6-r1.ebuild, +postgresql-server-9.1.2-r2.ebuild: Fixes bugs 395263, 394389, and 394159