Summary: | Bad runscript in dev-db/postgresql-server | ||
---|---|---|---|
Product: | Gentoo/Alt | Reporter: | Dmitri Bogomolov <4glitch> |
Component: | FreeBSD | Assignee: | Gentoo/BSD Team <bsd+disabled> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | bsd+disabled, naota, titanofold |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | FreeBSD | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Dmitri Bogomolov
2011-08-12 12:19:44 UTC
Excuse me, please. Actual results should be: 1: # /etc/init.d/postgresql-9.0 start * Starting PostgreSQL ... [[: not found [ ok ] PID TT STAT TIME COMMAND 1537 ?? Ss 0:00.56 /usr/lib/postgresql-9.0/bin/postgres --silent-mode=true 2: # /etc/init.d/postgresql-9.0 stop * Stopping PostgreSQL (this can take up to 92 seconds) ... [[: not found * NICE_QUIT disabled. * You really should have it enabled. [[: not found * RUDE_QUIT disabled. [[: not found * FORCE_QUIT disabled. * Unable to shutdown server. [ !! ] * ERROR: postgresql-9.0 failed to stop postgresql team, please fix your init scripts. Init scripts should not depend on bash features like "[[ ]]". Please check the latest revisions before submitting a bug. The Bash features being used in the init script was resolved quite some time ago. (In reply to comment #3) > Please check the latest revisions before submitting a bug. The Bash features > being used in the init script was resolved quite some time ago. Latest versions cannot be installed on g/fbsd. I mentioned this above. I don't see it get fixed here, it's still using "[[ ]]": http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.4-r1?revision=1.2&view=markup and postgresql.init-9.0-r1 should have the same code. $ cvs diff -u files/postgresql.init-8.4-r1 files/postgresql.init-9.0-r1 (no output, meaning two files are same) sorry if I missed something. Surely, new bashism were introduced with -r1. Reopening the bug. diff -u postgresql.init-8.4 postgresql.init-8.4-r1 <snip> + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-8.4/bin/pg_ctl start ${WAIT_FOR_START} -t ${START_TIMEOUT} -s -o '--silent-mode=true ${PGOPTS}'" + retval=$? + + if [[ $retval != 0 ]] ; then + eend $retval + return $retval + fi + + # The following is to catch the case of an already running server + # in which pg_ctl doesn't know to which server it connected to and + # falsely reports the server as 'up' <snip> + ebegin "Stopping PostgreSQL (this can take up to $(( ${NICE_TIMEOUT} + ${RUDE_TIMEOUT} + ${FORCE_TIMEOUT} )) seconds)" - local retval + local retval + if [[ "${NICE_QUIT}" != "NO" ]] ; then su -l ${PGUSER} \ - -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.4/bin/pg_ctl stop -t ${WAIT_FOR_DISCONNECT} -m smart" - <snip> (In reply to comment #4) > (In reply to comment #3) > > Please check the latest revisions before submitting a bug. The Bash features > > being used in the init script was resolved quite some time ago. > > Latest versions cannot be installed on g/fbsd. I mentioned this above. And yet it's still fixed. I will not reintroduce another bug to fix this one. (In reply to comment #6) > Surely, new bashism were introduced with -r1. Reopening the bug. And surely it was fixed shortly after that as the latest ebuild revisions grab the scripts not from files/ but from here: http://dev.gentoo.org/~titanofold/ You'll have to run the following command on the files: sed 's/@SLOT@/9.0/g' -i postgresql.{confd,init} Change out '9.0' for the actual slot you need. > (In reply to comment #6)
> > Surely, new bashism were introduced with -r1. Reopening the bug.
>
> And surely it was fixed shortly after that as the latest ebuild revisions grab
> the scripts not from files/ but from here:
>
> http://dev.gentoo.org/~titanofold/
>
> You'll have to run the following command on the files:
> sed 's/@SLOT@/9.0/g' -i postgresql.{confd,init}
>
> Change out '9.0' for the actual slot you need.
OK, I got it. Sorry for my misunderstanding.
Would the newest init scripts work for the older versions? If it works, may I change older ebuilds to grab init scripts from the url? (at least for BSD?)
(In reply to comment #7) > > Latest versions cannot be installed on g/fbsd. I mentioned this above. > > And yet it's still fixed. I will not reintroduce another bug to fix this one. So mask it and say goodbye to postgres in g/fbsd. |