Subject: pkg/30312: PostgreSQL 8 rc.d script problem while doing initdb
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <mishka@apk.od.ua>
List: pkgsrc-bugs
Date: 05/23/2005 14:06:00
>Number:         30312
>Category:       pkg
>Synopsis:       PostgreSQL 8 rc.d script problem while doing initdb
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 23 14:06:00 +0000 2005
>Originator:     Mike M. Volokhov
>Release:        NetBSD 3.99.3
>Organization:
	ISPK
>Environment:
System: NetBSD nostromo.holding.local 3.99.3 NetBSD 3.99.3 (GENERIC) #0: Sat Apr 9 02:07:43 EEST 2005 mishka@nostromo.holding.local:/build/netbsd/obj-08042005/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:

	Greetings!

	After first installing postgresql80-server, i've ran
	"rc.d/pgsql initdb" command, failed with following output:

	# /etc/rc.d/pgsql initdb
	Initializing PostgreSQL databases.
	initdb: unknown option -- m
	Try "initdb --help" for more information.

	This happens because $common_args variable contains "-m fast" flag,
	which is for "pg_ctl shutdown" only.
	
>How-To-Repeat:

	# cd pkgsrc/databases/postgresql80-server
	# make install
	# /usr/pkg/share/examples/rc.d/pgsql.sh forceinitdb

>Fix:

	Please use the following trivial patch for
	pkgsrc/databases/postgresql80-server/files/pgsql.sh file:

Index: pgsql.sh
===================================================================
RCS file: /usr/home/mishka/NetBSD-CVS/pkgsrc/databases/postgresql80-server/files/pgsql.sh,v
retrieving revision 1.2
diff -u -r1.2 pgsql.sh
--- pgsql.sh	16 May 2005 01:02:20 -0000	1.2
+++ pgsql.sh	23 May 2005 13:50:47 -0000
@@ -42,9 +42,9 @@
 fi
 
 pidfile="${pgsql_home}/data/postmaster.pid"
-common_args="-D ${pgsql_home}/data -m fast"
+common_args="-D ${pgsql_home}/data"
 start_command_args="-w -s -l ${pgsql_home}/errlog"
-stop_command_args="-s"
+stop_command_args="-s -m fast"
 
 initdb_cmd="pgsql_initdb"
 start_precmd="pgsql_precmd"

	--
	Best regards,
	Mishka.