The problem previously reported on freebsd-ports@ hasn't been fixed,

and a user contacted me privately asking for a fix. This fix was
proposed on the list and tested by the user who contacted me privately.

The problem is that _flags can't be modified in start_precmd, and
shouldn't have been abused this way in the first place. The previous
version resulted in couchdb staying in the foreground.

This patch could be refined further, but it solves the immediate problem.
This commit is contained in:
Doug Barton 2012-01-26 06:31:26 +00:00
parent 0a47528de8
commit a834d67e1a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=289828
2 changed files with 10 additions and 3 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= couchdb PORTNAME= couchdb
PORTVERSION= 1.1.0 PORTVERSION= 1.1.0
PORTREVISION= 2 PORTREVISION= 3
PORTEPOCH= 1 PORTEPOCH= 1
CATEGORIES= databases CATEGORIES= databases
MASTER_SITES= ${MASTER_SITE_APACHE} MASTER_SITES= ${MASTER_SITE_APACHE}

View file

@ -36,11 +36,18 @@ couchdb_respawn="${couchdb_respawn:-"0"}"
command="%%PREFIX%%/bin/${name}" command="%%PREFIX%%/bin/${name}"
pidfile="/var/run/${name}/${name}.pid" pidfile="/var/run/${name}/${name}.pid"
command_args="-p ${pidfile} -b"
couchdb_prestart() couchdb_prestart()
{ {
install -o $couchdb_user /dev/null $pidfile install -o $couchdb_user /dev/null $pidfile
[ -n "$couchdb_flags" ] && return 0 if [ -n "$couchdb_flags" ]; then
case "$couchdb_flags" in
*-[bp]*) err 1 'The -b and -p options should be removed from couchdb_flags' ;;
esac
return 0
fi
if [ $couchdb_respawn -gt 0 ]; then if [ $couchdb_respawn -gt 0 ]; then
respawn="-r ${couchdb_respawn}" respawn="-r ${couchdb_respawn}"
@ -54,7 +61,7 @@ couchdb_prestart()
errfile=/dev/null errfile=/dev/null
fi fi
couchdb_flags="-b -a ${couchdb_etcdir}/default.ini -a ${couchdb_etcdir}/local.ini ${respawn} -o ${logfile} -e ${errfile} -p ${pidfile}" command_args="-a ${couchdb_etcdir}/default.ini -a ${couchdb_etcdir}/local.ini ${respawn} -o ${logfile} -e ${errfile} ${command_args}"
} }
start_precmd=${name}_prestart start_precmd=${name}_prestart