Bug[?] In new local_startup and postgresql

Doug Barton dougb at FreeBSD.org
Thu Dec 22 02:04:22 PST 2005


Cristiano Deana wrote:
> 2005/12/22, Doug Barton <dougb at freebsd.org>:
> 
>> 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

-------------- next part --------------
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"


More information about the freebsd-ports mailing list