Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Aug 2008 16:33:43 +0100
From:      "Simon L. Nielsen" <simon@FreeBSD.org>
To:        freebsd-www@freebsd.org
Subject:   Re: query-pr for mirror site
Message-ID:  <20080816153342.GA1609@zaphod.nitro.dk>
In-Reply-To: <20080809070725.GA57707@rwpc12.mby.riverwillow.net.au>
References:  <20080809070725.GA57707@rwpc12.mby.riverwillow.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help

--mxv5cy4qt+RJ9ypb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On 2008.08.09 17:07:25 +1000, John Marshall wrote:

> I have been looking at getting some of the CGI scripts working (haven't
> found any documentation) and find that query-pr.cgi and friends need
> /usr/local/bin/query-pr.web.
> 
> I can't find query-pr.web anywhere. Perhaps it is part of a port which
> is no longer in the ports tree? Perhaps I just haven't looked hard
> enough?

No, this script is actually only directly on www.freebsd.org server,
but it is just a wrapper around query-pr which is there to limit
number of simultaneous queries.  I have attached it heree, just FYI.

We should probably stick it in www/...

> It occurs to me that a server which hosts a mirror of the web site and
> of the gnats repository ought to be able to provide PR query services
> without too much extra effort.

Well, GNATS can get tricky to work, and it's not pretty...

> I have discovered that to get the cvsweb.cgi script working I needed to
> install the devel/cvsweb3 port and create a link to the cvs repository;
> and that to get the ports.cgi script working I had to install the
> converters/p5-Convert-UU port and create a link to the ports tree.

Hmmm, AFAIR the port shouldn't be required... but I haven't messed
with it a while, so I can't recall.

> Is the rest of the CGI functionality/configuration documented somewhere
> - or shouldn't mirrors be providing these services?

It's not documented, and generally we don't expect mirrors to provide
CGI services.  Actually getting all scripts working is entirely non
trivial.  One reason for this is that at times we change stuff which
will require changes on the server if you use CGI's.

-- 
Simon L. Nielsen

--mxv5cy4qt+RJ9ypb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="query-pr.web"

#!/bin/sh
#
# wrapper for query-pr
#

PATH=/bin:/usr/bin:/usr/local/bin; export PATH

pid=$$
lockfile=/tmp/query-pr.lock 

# max. cpu limit in seconds
ulimit -t 30

# allow 2 processes at the same time - avoid locks by long running queries
case $pid in 
	*[0-4] ) lockfile=${lockfile}.1 ;; 
	*      ) lockfile=${lockfile}.2 ;;
esac

# no locking for --list commands
case $1 in
	--list-categories | --list-states | --list-classes ) exec /usr/local/bin/query-pr $1;;
esac

lockf -t 60 $lockfile nice -10 /usr/local/bin/query-pr "$@"
sleep 0.5


--mxv5cy4qt+RJ9ypb--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080816153342.GA1609>