From owner-freebsd-ports@FreeBSD.ORG Thu Dec 22 10:04:22 2005 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7683816A41F for ; Thu, 22 Dec 2005 10:04:22 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mail2.fluidhosting.com [204.14.90.12]) by mx1.FreeBSD.org (Postfix) with SMTP id E79AA43D45 for ; Thu, 22 Dec 2005 10:04:21 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: (qmail 75382 invoked by uid 399); 22 Dec 2005 09:38:22 -0000 Received: from localhost (HELO ?192.168.1.101?) (dougb@dougbarton.us@127.0.0.1) by localhost with SMTP; 22 Dec 2005 09:38:22 -0000 Message-ID: <43AA740C.7050903@FreeBSD.org> Date: Thu, 22 Dec 2005 01:38:20 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 1.5 (X11/20051203) MIME-Version: 1.0 To: Cristiano Deana References: <20051222022727.086a6a3c@it.buh.tecnik93.com> <43A9F6B3.9020302@FreeBSD.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------030103010607080206040009" Cc: freebsd-ports@freebsd.org Subject: Re: Bug[?] In new local_startup and postgresql X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2005 10:04:22 -0000 This is a multi-part message in MIME format. --------------030103010607080206040009 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cristiano Deana wrote: > 2005/12/22, Doug Barton : > >> The only thing odd I see there is that 010.pgsql.sh is run after >> 000.pkgtools.sh. I think the latter is for portupgrade, yes? If so, that >> shouldn't make any difference, right? > > THIS is the problem (sorry, i had no /var/log/console.log): > Dec 22 01:57:56 db kernel: pg_ctl: invalid operation mode: faststart Aha! That's an easy one! :) When booting normally from /etc/rc, the scripts are passed the argument faststart, not just start. Internally the "fast" is stripped within the run_rc_command function, but that doesn't help the script that (bogusly) assumes that the argument will be simply "start" or "stop." The attached patch fixes this problem for me, although I don't have a real postgres installed, I just quickly installed the port so that I could test this. Please let us know if this works for you. Doug -- This .signature sanitized for your protection --------------030103010607080206040009 Content-Type: text/plain; name="pgsql.sh.tmp1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pgsql.sh.tmp1.diff" Index: pgsql.sh.tmpl =================================================================== RCS file: /home/pcvs/ports/databases/postgresql73-server/files/pgsql.sh.tmpl,v retrieving revision 1.16 diff -u -r1.16 pgsql.sh.tmpl --- pgsql.sh.tmpl 19 Mar 2005 03:51:44 -0000 1.16 +++ pgsql.sh.tmpl 22 Dec 2005 09:36:59 -0000 @@ -35,9 +35,14 @@ name=postgresql rcvar=`set_rcvar` command=${prefix}/bin/pg_ctl -command_args="-D ${postgresql_data} ${postgresql_flags} $1" extra_commands="reload initdb" +case "$1" in +*start) arg1=start ;; +*stop) arg1=stop ;; +esac +command_args="-D ${postgresql_data} ${postgresql_flags} $arg1" + start_cmd="postgresql_command start" stop_cmd="postgresql_command stop" restart_cmd="postgresql_command restart" --------------030103010607080206040009--