From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Dec 24 19:10:07 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 22DDD16A41F for ; Sat, 24 Dec 2005 19:10:07 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D896643D60 for ; Sat, 24 Dec 2005 19:10:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id jBOJA3Fj070421 for ; Sat, 24 Dec 2005 19:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id jBOJA3AB070416; Sat, 24 Dec 2005 19:10:03 GMT (envelope-from gnats) Resent-Date: Sat, 24 Dec 2005 19:10:03 GMT Resent-Message-Id: <200512241910.jBOJA3AB070416@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Victor Snezhko Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C36F716A423 for ; Sat, 24 Dec 2005 19:07:43 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D78143D4C for ; Sat, 24 Dec 2005 19:07:43 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id jBOJ7hEW093257 for ; Sat, 24 Dec 2005 19:07:43 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id jBOJ7hjO093256; Sat, 24 Dec 2005 19:07:43 GMT (envelope-from nobody) Message-Id: <200512241907.jBOJ7hjO093256@www.freebsd.org> Date: Sat, 24 Dec 2005 19:07:43 GMT From: Victor Snezhko To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: ports/90884: [patch] PostgreSQL startup script doesn't understand faststart and faststop commands X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2005 19:10:07 -0000 >Number: 90884 >Category: ports >Synopsis: [patch] PostgreSQL startup script doesn't understand faststart and faststop commands >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Dec 24 19:10:02 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Victor Snezhko >Release: FreeBSD 7.0-CURRENT i386 >Organization: IndorSoft >Environment: System: FreeBSD freebsd.indorsoft.ru 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Fri Dec 23 00:23:34 NOVT 2005 root@freebsd.indorsoft.ru:/home/vvs/obj/usr/src/sys/VVS i386 >Description: PostgreSQL startup script is using it's argument incorrectly. It assumes that argument will be one of "start", "stop", "reload" and others, and passes this argument to pg_ctl. But the argument can be prefixed. "fast" is the prefix that is used on startup (there are others), and when system is booting, it runs pgsql.sh with "faststart" argument, which is happily passed to pg_ctl, and pg_ctl complains about it, and postgresql isn't started at all, at least on -current >How-To-Repeat: install databases/postgresql81-server add postgresql_enable="YES" to /etc/rc.conf reboot - at startup and shutdown you will see that pg_ctl complains about unknown faststart and faststop commands >Fix: rc.subr(5) contains code that cleans argument from prefixes, and provides $rc_arg variable as the result. I suggest changing "$1" to $rc_arg and pass it to pg_ctl There is a patch against databases/postgresql81-server's script: ======================================================= --- /usr/ports/databases/postgresql81-server/files/pgsql.sh.tmpl Wed Dec 14 01:17:13 2005 +++ /usr/local/etc/rc.d/010.pgsql.sh Sun Dec 25 00:19:45 2005 @@ -35,7 +35,7 @@ name=postgresql rcvar=`set_rcvar` command=${prefix}/bin/pg_ctl -command_args="-D ${postgresql_data} ${postgresql_flags} $1" +command_args="-D ${postgresql_data} ${postgresql_flags}" extra_commands="reload initdb" start_cmd="postgresql_command start" @@ -48,7 +48,7 @@ postgresql_command() { - su -l ${postgresql_user} -c "exec ${command} ${command_args}" + su -l ${postgresql_user} -c "exec ${command} ${command_args} ${rc_arg}" } postgresql_initdb() ======================================================= >Release-Note: >Audit-Trail: >Unformatted: