debian/0000755000000000000000000000000012241130255007161 5ustar debian/control0000644000000000000000000000354412240634631010600 0ustar Source: globus-rls-server Priority: optional Maintainer: Mattias Ellert Build-Depends: debhelper (>= 5), autotools-dev, grid-packaging-tools (>= 3.4), globus-core (>= 8.16), libglobus-gss-assist-dev (>= 9), libglobus-common-dev (>= 14.10), libglobus-usage-dev (>= 3.1-4~), libglobus-rls-client-dev (>= 5.2-10~), libglobus-io-dev (>= 9.5), unixodbc-dev Standards-Version: 3.9.4 Section: net Vcs-Browser: http://svn.nordugrid.org/trac/packaging/browser/debian/globus-rls-server Vcs-Svn: http://svn.nordugrid.org/repos/packaging/debian/globus-rls-server Homepage: http://www.globus.org/ Package: globus-rls-server Section: net Architecture: any Multi-Arch: foreign Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} Description: Globus Toolkit - Replica Location Service Server The Globus Toolkit is an open source software toolkit used for building Grid systems and applications. It is being developed by the Globus Alliance and many others all over the world. A growing number of projects and companies are using the Globus Toolkit to unlock the potential of grids for their cause. . The globus-rls-server package contains: Replica Location Service Server Replica Location Service Server Setup Package: globus-rls-server-dbg Section: debug Priority: extra Architecture: any Multi-Arch: foreign Depends: globus-rls-server (= ${binary:Version}), ${misc:Depends} Description: Globus Toolkit - Replica Location Service Server Debug Symbols The Globus Toolkit is an open source software toolkit used for building Grid systems and applications. It is being developed by the Globus Alliance and many others all over the world. A growing number of projects and companies are using the Globus Toolkit to unlock the potential of grids for their cause. . The globus-rls-server-dbg package contains: Replica Location Service Server Debug Symbols debian/rules0000755000000000000000000001644212240121204010241 0ustar #!/usr/bin/make -f # -*- makefile -*- name = globus-rls-server _name = globus_rls_server version = 4.9 INSTALLDIR = $(CURDIR)/debian/tmp GLOBUSPACKAGEDIR = $(INSTALLDIR)$(_datadir)/globus/packages _prefix = /usr _bindir = $(_prefix)/bin _sbindir = $(_prefix)/sbin _libdir = $(_prefix)/lib/$(DEB_HOST_MULTIARCH) _datadir = $(_prefix)/share _mandir = $(_datadir)/man _docdir = $(_datadir)/doc/$(name) DEB_HOST_ARCH_BITS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) ifeq ($(DEB_HOST_ARCH_BITS), 64) flavor = gcc64-$(DEB_HOST_MULTIARCH) else flavor = gcc32-$(DEB_HOST_MULTIARCH) endif sed: sed-stamp sed-stamp: dh_testdir for f in server.c Doc/man/man8/globus-rls-server.8 ; do \ sed 's!/usr/local/etc!/etc!g' -i $$f ; \ done touch $@ unsed: dh_testdir if [ -e sed-stamp ] ; then \ for f in server.c Doc/man/man8/globus-rls-server.8 ; do \ sed 's!\([ \"]\)/etc!\1/usr/local/etc!g' -i $$f ; \ done ; \ fi rm -f sed-stamp configure: configure-stamp configure-stamp: sed-stamp dh_testdir dh_autotools-dev_updateconfig /usr/share/globus/globus-bootstrap.sh ./configure \ --disable-static \ --with-flavor=$(flavor) \ --with-docdir=$(_docdir) # Reduce overlinking sed 's!CC -shared !CC \\$${wl}--as-needed -shared !g' -i libtool cd setup && /usr/share/globus/globus-bootstrap.sh cd setup && ./configure \ --disable-static \ --without-flavor \ --with-docdir=$(_docdir) touch $@ build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp: configure-stamp dh_testdir $(MAKE) cd setup && $(MAKE) touch $@ clean: unsed dh_testdir dh_testroot if [ -r Makefile ] ; then $(MAKE) distclean ; fi dh_autotools-dev_restoreconfig # Remove autogenerated files rm -f aclocal.m4 rm -f compile rm -f configure rm -f install-sh rm -f ltmain.sh rm -f missing rm -f mkinstalldirs rm -f doxygen/Doxyfile* rm -f doxygen/Makefile.am rm -f pkgdata/Makefile.am rm -f pkgdata/*.filelist rm -f pkgdata/*.gpt rm -f pkgdata/$(name).pc rm -f pkgdata/pkg_data_src.pc.in rm -f gptdata.sh rm -f globus_automake* rm -rf autom4te.cache cd setup && if [ -r Makefile ] ; then $(MAKE) distclean ; fi # Remove autogenerated files rm -f setup/aclocal.m4 rm -f setup/compile rm -f setup/configure rm -f setup/install-sh rm -f setup/ltmain.sh rm -f setup/missing rm -f setup/mkinstalldirs rm -f setup/doxygen/Doxyfile* rm -f setup/doxygen/Makefile.am rm -f setup/pkgdata/Makefile.am rm -f setup/pkgdata/*.filelist rm -f setup/pkgdata/*.gpt rm -f setup/pkgdata/$(name)-setup.pc rm -f setup/pkgdata/pkg_data_src.pc.in rm -f setup/gptdata.sh rm -f setup/globus_automake* rm -rf setup/autom4te.cache find . -name Makefile.in -exec rm {} ';' rm -f build-stamp configure-stamp dh_clean debian/*.install install: build-stamp dh_testdir dh_testroot dh_prep $(MAKE) install DESTDIR=$(INSTALLDIR) cd setup && $(MAKE) install DESTDIR=$(INSTALLDIR) # This script is intended to be sourced, not executed chmod 644 $(INSTALLDIR)$(_datadir)/globus/setup/setup-globus-rls-server.pl # Remove the SXXrls.in file rm $(INSTALLDIR)$(_datadir)/globus/setup/SXXrls.in sed /SXXrls.in/d \ -i $(GLOBUSPACKAGEDIR)/$(_name)_setup/noflavor_data.filelist sed -e 's/"SXXrls", //' -e '/SXXrls/d' \ -i $(INSTALLDIR)$(_datadir)/globus/setup/setup-globus-rls-server.pl # Fix man page section sed 's!^\(\.TH.*\) 1 !\1 8 !' \ $(INSTALLDIR)$(_mandir)/man1/globus-rls-reporter.1 > \ $(INSTALLDIR)$(_mandir)/man8/globus-rls-reporter.8 rm $(INSTALLDIR)$(_mandir)/man1/globus-rls-reporter.1 sed 's!/man1/\(.*\)\.1!/man8/\1.8!' \ -i $(GLOBUSPACKAGEDIR)/$(_name)/noflavor_doc.filelist # Create setup files mkdir -p $(INSTALLDIR)/etc cat $(INSTALLDIR)$(_datadir)/globus/setup/odbc.ini.in \ | sed -e s!@libdir@!$(_libdir)/odbc!g \ -e s!@localstatedir@!/var/lib/$(name)!g \ -e s!libmyodbc3_r!libmyodbc!g \ -e s!psqlodbc!psqlodbcw!g \ -e s!@SQLITEODBCFLAVOR@!!g \ -e s!@LIBSUFFIX@!so!g \ > $(INSTALLDIR)/etc/$(name)-odbc.ini cat $(INSTALLDIR)$(_datadir)/globus/setup/$(name).conf.in \ | sed -e s!@ODBCINI@!/etc/$(name)-odbc.ini!g \ -e 's!^odbcini.*$$!&\npidfile\t\t\t/var/run/$(name).pid!g' \ > $(INSTALLDIR)/etc/$(name).conf chmod 600 $(INSTALLDIR)/etc/$(name).conf cat $(INSTALLDIR)$(_datadir)/globus/setup/rls-ldif.conf.in \ | sed s!@sbindir@!$(_sbindir)!g \ > $(INSTALLDIR)/etc/rls-ldif.conf # Remove pkg-config files... rm $(INSTALLDIR)$(_libdir)/pkgconfig/$(name).pc rm $(INSTALLDIR)$(_prefix)/lib/pkgconfig/$(name)-setup.pc rm $(GLOBUSPACKAGEDIR)/$(_name)/$(flavor)_dev.filelist rm $(GLOBUSPACKAGEDIR)/$(_name)/pkg_data_$(flavor)_dev.gpt rm $(GLOBUSPACKAGEDIR)/$(_name)_setup/noflavor_dev.filelist rm $(GLOBUSPACKAGEDIR)/$(_name)_setup/pkg_data_noflavor_dev.gpt # Remove installed license file rm -f $(INSTALLDIR)$(_docdir)/GLOBUS_LICENSE sed /GLOBUS_LICENSE/d \ -i $(GLOBUSPACKAGEDIR)/$(_name)/noflavor_doc.filelist # Generate package filelists cat $(GLOBUSPACKAGEDIR)/$(_name)/$(flavor)_pgm.filelist \ $(GLOBUSPACKAGEDIR)/$(_name)/noflavor_data.filelist \ $(GLOBUSPACKAGEDIR)/$(_name)_setup/noflavor_pgm.filelist \ $(GLOBUSPACKAGEDIR)/$(_name)_setup/noflavor_data.filelist \ $(GLOBUSPACKAGEDIR)/$(_name)/noflavor_doc.filelist \ | sed -e s!^!debian/tmp$(_prefix)! -e s!$(_prefix)/etc!/etc! \ > debian/$(name).install echo debian/tmp/etc/$(name)-odbc.ini \ >> debian/$(name).install echo debian/tmp/etc/$(name).conf \ >> debian/$(name).install echo debian/tmp/etc/rls-ldif.conf \ >> debian/$(name).install binary: binary-arch binary-indep binary-arch: install dh_testdir dh_testroot dh_installdocs debian/README dh_installchangelogs dh_install --fail-missing dh_installman dh_lintian # We should start after and stop before mysql dh_installinit -- start 82 2 3 4 5 . stop 18 0 1 6 . dh_link dh_strip --dbg-package=$(name)-dbg dh_compress dh_fixperms -X globus-rls-server.conf dh_perl dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary-indep: get-orig-source: if [ -r $(name)_$(version).orig.tar.gz ] ; then \ echo "$(name)_$(version).orig.tar.gz already exists." ; \ else \ if [ ! -r gt5.0.0-all-source-installer.tar.bz2 ] ; then \ echo "Downloading Globus Toolkit release." ; \ echo "This should be necessary only once for all globus packages." ; \ wget -N http://www-unix.globus.org/ftppub/gt5/5.0/5.0.0/installers/src/gt5.0.0-all-source-installer.tar.bz2 ; \ fi ; \ echo "Extracting relevant parts of the Globus Toolkit release." ; \ tar -xjf gt5.0.0-all-source-installer.tar.bz2 \ gt5.0.0-all-source-installer/source-trees/replica/rls/server \ gt5.0.0-all-source-installer/source-trees/replica/rls/setup ; \ mv gt5.0.0-all-source-installer/source-trees/replica/rls/server \ $(name)-$(version) ; \ mv gt5.0.0-all-source-installer/source-trees/replica/rls/setup \ $(name)-$(version) ; \ echo "Packing it up again." ; \ GZIP=-9 tar --exclude=CVS -czf $(name)_$(version).orig.tar.gz \ $(name)-$(version) ; \ echo "Cleaning up." ; \ rm -rf gt5.0.0-all-source-installer $(name)-$(version) ; \ fi .PHONY: binary binary-arch binary-indep build build-arch build-indep clean configure install get-orig-source debian/README0000644000000000000000000000147211705371652010061 0ustar This package is part of the Replica Location Service (RLS) component of the Globus Toolkit. For more information visit: http://www.globus.org/toolkit/docs/5.0/5.0.4/data/rls/ Admin Guide: http://www.globus.org/toolkit/docs/5.0/5.0.4/data/rls/admin/ User's Guide: http://www.globus.org/toolkit/docs/5.0/5.0.4/data/rls/user/ Developer's Guide: http://www.globus.org/toolkit/docs/5.0/5.0.4/data/rls/developer/ Release Notes: http://www.globus.org/toolkit/docs/5.0/5.0.4/data/rls/rn/ Public Interface Guide: http://www.globus.org/toolkit/docs/5.0/5.0.4/data/rls/pi/ Quality Profile: http://www.globus.org/toolkit/docs/5.0/5.0.4/data/rls/qp/ Migrating Guide: http://www.globus.org/toolkit/docs/5.0/5.0.4/data/rls/mig/ Globus debian packaging is supported by the Initiative for Globus in Europe: http://www.ige-project.eu/ debian/globus-rls-server.lintian-overrides0000644000000000000000000000023211555601021016134 0ustar # The globus-rls-server.conf contains the database password and should # therefore not be world readable globus-rls-server binary: non-standard-file-perm debian/copyright0000644000000000000000000000121511677034616011133 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: globus_rls_server Upstream-Contact: http://www.globus.org/ Source: http://www-unix.globus.org/ftppub/gt5/5.0/5.0.0/installers/src/gt5.0.0-all-source-installer.tar.bz2 Files: * Copyright: 1999-2011 University of Chicago License: Apache-2.0 Files: debian/* Copyright: 2008-2011 Mattias Ellert 2010-2011 Initiative for Globus in Europe (IGE), http://www.ige-project.eu/ License: Apache-2.0 License: Apache-2.0 On Debian systems the full text of the Apache license version 2 can be found in /usr/share/common-licenses/Apache-2.0. debian/globus-rls-server.init0000644000000000000000000001060011642124531013444 0ustar #!/bin/sh ### BEGIN INIT INFO # Provides: globus-rls-server # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Should-Start: mysql postgresql # Should-Stop: mysql postgresql # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time # Description: Replica Location Service Server ### END INIT INFO # compare with http://wiki.debian.org/LSBInitScripts for the above section # Starts / stops the Globus RLS server. GLOBUS_RLS_SERVER=/usr/sbin/globus-rls-server GLOBUS_RLS_ADMIN=/usr/sbin/globus-rls-admin NAME=globus-rls-server DESC="Globus RLS server" PIDFILE=/var/run/$NAME.pid test -x $GLOBUS_RLS_SERVER || exit 0 port=`grep '^port' /etc/globus-rls-server.conf | sed 's/port\s*//'` port=${port:-39281} . /lib/lsb/init-functions # Default options, these can be overriden by the information # at /etc/default/$NAME DIETIME=3 STARTTIME= # Include defaults if available if [ -f /etc/default/$NAME ] ; then . /etc/default/$NAME fi if [ "x$RUN" != "xyes" ] ; then log_warning_msg "$NAME disabled, please adjust the configuration to your needs " log_warning_msg "and then set RUN to 'yes' in /etc/default/$NAME to enable it." log_warning_msg "See /usr/share/doc/$NAME/README.Debian.gz for details." exit 0 fi set -e running_pid() { # Check if a given process pid's cmdline matches a given name pid=$1 name=$2 [ -z "$pid" ] && return 1 [ ! -d /proc/$pid ] && return 1 cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` # Is this the expected server [ "$cmd" != "$name" ] && return 1 return 0 } running() { # Check if the process is running looking at /proc (works for all users) # No pidfile, probably no daemon present [ ! -f "$PIDFILE" ] && return 1 pid=`cat $PIDFILE` running_pid $pid $GLOBUS_RLS_SERVER || return 1 return 0 } start_server() { $GLOBUS_RLS_SERVER errcode=$? return $errcode } stop_server() { $GLOBUS_RLS_ADMIN -q rls://localhost:$port errcode=$? return $errcode } force_stop() { # Force the process to die killing it manually [ ! -e "$PIDFILE" ] && return if running ; then kill -15 $pid # Is it really dead? [ -n "$DIETIME" ] && sleep $DIETIME if running ; then kill -9 $pid [ -n "$DIETIME" ] && sleep $DIETIME if running ; then echo "Cannot kill $NAME (pid=$pid)!" exit 1 fi fi fi rm -f $PIDFILE } case "$1" in start) log_daemon_msg "Starting $DESC" "$NAME" # Check if it's running first if running ; then log_progress_msg "apparently already running" log_end_msg 0 exit 0 fi if start_server ; then [ -n "$STARTTIME" ] && sleep $STARTTIME if running ; then # It's ok, the server started and is running log_end_msg 0 else # It is not running after we did start log_end_msg 1 fi else # We could not start it log_end_msg 1 fi ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" if running ; then # Only stop the server if we see it running errcode=0 stop_server || errcode=$? log_end_msg $errcode else # If it's not running don't do anything log_progress_msg "apparently not running" log_end_msg 0 exit 0 fi ;; force-stop) # First try to stop gracefully the program $0 stop if running; then # If it's still running try to kill it more forcefully log_daemon_msg "Stopping (force) $DESC" "$NAME" errcode=0 force_stop || errcode=$? log_end_msg $errcode fi ;; restart|force-reload) log_daemon_msg "Restarting $DESC" "$NAME" errcode=0 stop_server || errcode=$? # Wait some sensible amount, some server need this [ -n "$DIETIME" ] && sleep $DIETIME start_server || errcode=$? [ -n "$STARTTIME" ] && sleep $STARTTIME running || errcode=$? log_end_msg $errcode ;; status) log_daemon_msg "Checking status of $DESC" "$NAME" if running ; then log_progress_msg "running" log_end_msg 0 $GLOBUS_RLS_ADMIN -S rls://localhost:$port else log_progress_msg "apparently not running" log_end_msg 1 exit 1 fi ;; reload) log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon" log_warning_msg "cannot re-read the config file (use restart)." ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2 exit 1 ;; esac exit 0 debian/README.source0000644000000000000000000000062011573132163011345 0ustar The source for this package was extracted from the upstream tarfile: http://www-unix.globus.org/ftppub/gt5/5.0/5.0.0/installers/src/gt5.0.0-all-source-installer.tar.bz2 See the get-orig-source rule in the debian/rules file for details. The version of this package was not changed in Globus Toolkit 5.0.2, 5.0.3 and 5.0.4 so the source tarfile extracted from Globus Toolkit 5.0.0 was not replaced. debian/README.Debian0000644000000000000000000001632311406445443011241 0ustar How to set up a Globus RLS server ================================= After installing the globus-rls-server package the server's database backend must be configured and its database tables created. The Globus RLS server is built using unixODBC and the server administrator therefore can choose between different database backends. Database definitions are provided for MySQL, postgres, sqlite and oracle. The Globus RLS server consists of two parts, the local replica catalog (LRC) and the replica location index (RLI). A server can run either one or both. The instructions below enables both services. If only one of the services is needed the instruction for creating the database tables for the other service can be ignored. The default configuration file /etc/globus-rls-server.conf have both lrc_server and rli_server set to true. If only one of the services is required the entry for the other one should be changed to false. A) MySQL MySQL version 4.0.1 or later is required in order to have support for the database transaction features used by the Globus RLS server. Without proper support for these features the reference counters in the MySQL tables will get out of synch. The MySQL ODBC driver is needed. It can be installed using: apt-get install libmyodbc The MySQL server used as a backend can be running on the same host as the Globus RLS server or on a different host if that is preferred. A-1) Creating tables Start the mysql tool and issue the following commands, replacing the dbuser and dbpassword with the database username and password you will be using for the Globus RLS server. mysql> use mysql; mysql> grant all on lrc1000.* to dbuser@localhost identified by 'dbpassword'; mysql> grant all on rli1000.* to dbuser@localhost identified by 'dbpassword'; If you are using a MySQL database on a different host than the one running the Globus RLS server repeat the two last lines with localhost replaced with the hostname of the Globus RLS Server. Create the databases by running the following commands, replacing dbuser with the database username you specified above. If you are using a different database host than the Globus RLS server host you can either copy the database definition files to the MySQL host or run the commands on the Globus RLS server host and add a -h flag indicating the hostname of the MySQL server. You will be promted for the password. mysql -p -u dbuser < /usr/share/globus/setup/globus-rls-lrc-mysql.sql mysql -p -u dbuser < /usr/share/globus/setup/globus-rls-rli-mysql.sql A-2) Configuring the Globus RLS server Edit the file /etc/globus-rls-server.conf and specify the database username and password you have been using. Also change the lrc_dbname and rli_dbname to lrc1000_mysql and rli1000_mysql respectivley. Make sure this file is not world readable to protect the password. If you are not using a MySQL server on the same host as the Globus RLS server, edit the /etc/globus-rls-server-odbc.ini file and add a Servername entry to the definitions of lrc1000_mysql and rli1000_mysql providing the hostname of the MySQL server. The default access control list gives all users the right to do everything. If this is not what is intended, you should modify the acl entry in the /etc/globus-rls-server.conf file. A-3) Starting the server Enable automatic start up of the server by changing RUN=no to RUN=yes in /etc/default/globus-rls-server, then start the server using: invoke-rc.d globus-rls-server start Once the server is running you can use the globus-rls-admin command to let the LRC and/or RLI send updates to RLI servers. If the server is running both an LRC and an RLI you can let the LRC send updates to the RLI in the same server. Sending RLI updates is optional. B) postgres The postgres ODBC driver is needed. It can be installed using: apt-get install odbc-postgresql The postgres server used as a backend can be running on the same host as the Globus RLS server or on a different host if that is preferred. B-1) Creating tables Create a database user for the Globus RLS server using the following command on the database host, replacing dbuser with the database username you will be using. You will be prompted for a password for the new user. createuser -P dbuser Create the databases using the following commands, replacing dbuser with the database username created above. If you are using a different database host than the Globus RLS server host you can either copy the database definition files to the postgresql host or run the commands on the Globus RLS server host and add a -h flag indicating the hostname of the postgresql server. You will be promted for the password. createdb -O dbuser -U dbuser -W lrc1000 createdb -O dbuser -U dbuser -W rli1000 psql -W -U dbuser -d lrc1000 -f /usr/share/globus/setup/globus-rls-lrc-postgres.sql psql -W -U dbuser -d rli1000 -f /usr/share/globus/setup/globus-rls-rli-postgres.sql B-2) Configuring the Globus RLS server Edit the file /etc/globus-rls-server.conf and specify the database username and password you have been using. Also change the lrc_dbname and rli_dbname to lrc1000_psql and rli1000_psql respectivley. Make sure this file is not world readable to protect the password. If you are not using a postgresql server on the same host as the Globus RLS server, edit the /etc/globus-rls-server-odbc.ini file and change the Servername entry in the definitions of lrc1000_psql and rli1000_psql providing the hostname of the postgresql server. The default access control list gives all users the right to do everything. If this is not what is intended, you should modify the acl entry in the /etc/globus-rls-server.conf file. B-3) Starting the server Enable automatic start up of the server by changing RUN=no to RUN=yes in /etc/default/globus-rls-server, then start the server using: invoke-rc.d globus-rls-server start Once the server is running you can use the globus-rls-admin command to let the LRC and/or RLI send updates to RLI servers. If the server is running both an LRC and an RLI you can let the LRC send updates to the RLI in the same server. Sending RLI updates is optional. C) sqlite The sqlite ODBC driver is needed. It can be installed using: apt-get install libsqliteodbc C-1) Creating tables Use sqlite to create the database tables: mkdir -p /var/lib/globus-rls-server sqlite3 /var/lib/globus-rls-server/lrc1000.db < /usr/share/globus/setup/globus-rls-lrc-sqlite.sql sqlite3 /var/lib/globus-rls-server/rli1000.db < /usr/share/globus/setup/globus-rls-rli-sqlite.sql C-2) Configuring the Globus RLS server The default access control list gives all users the right to do everything. If this is not what is intended, you should modify the acl entry in the /etc/globus-rls-server.conf file. C-3) Starting the server Enable automatic start up of the server by changing RUN=no to RUN=yes in /etc/default/globus-rls-server, then start the server using: invoke-rc.d globus-rls-server start Once the server is running you can use the globus-rls-admin command to let the LRC and/or RLI send updates to RLI servers. If the server is running both an LRC and an RLI you can let the LRC send updates to the RLI in the same server. Sending RLI updates is optional. D) oracle Configuring the Globus RLS server for the oracle backend is left as en exercise for the reader. debian/compat0000644000000000000000000000000211677033025010370 0ustar 5 debian/globus-rls-server.default0000644000000000000000000000000711406445443014133 0ustar RUN=no debian/patches/0000755000000000000000000000000011711210442010606 5ustar debian/patches/globus-rls-server-gt503.patch0000644000000000000000000000435011532214504016072 0ustar diff -ur -ur globus_rls_server-4.9/admin.c globus_rls_server-4.9/admin.c --- globus_rls_server-4.9/admin.c 2009-10-26 18:10:27.000000000 +0100 +++ globus_rls_server-4.9/admin.c 2011-01-31 21:36:12.000000000 +0100 @@ -43,6 +43,14 @@ static void usage(char *prog); +void print_count(char *string, int count) +{ + if (count < 0) + printf("%s--\n", string); + else + printf("%s%d\n", string, count); +} + int main(int argc, char **argv) @@ -240,9 +248,9 @@ printf(" lfnlist update interval: %d\n", rlsstats.lrc_lfnlistui); printf(" bloomfilter update interval: %d\n", rlsstats.lrc_bloomfilterui); - printf(" numlfn: %d\n", rlsstats.lrc_numlfn); - printf(" numpfn: %d\n", rlsstats.lrc_numpfn); - printf(" nummap: %d\n", rlsstats.lrc_nummap); + print_count(" numlfn: ", rlsstats.lrc_numlfn); + print_count(" numpfn: ", rlsstats.lrc_numpfn); + print_count(" nummap: ", rlsstats.lrc_nummap); } if (rlsstats.flags & RLS_RLISERVER) { @@ -271,10 +279,10 @@ globus_rls_client_free_list(list); } if (rlsstats.flags & RLS_RCVLFNLIST) { - printf(" numlfn: %d\n", rlsstats.rli_numlfn); - printf(" numlrc: %d\n", rlsstats.rli_numlrc); - printf(" numsender: %d\n", rlsstats.rli_numsender); - printf(" nummap: %d\n", rlsstats.rli_nummap); + print_count(" numlfn: ", rlsstats.rli_numlfn); + print_count(" numlrc: ", rlsstats.rli_numlrc); + print_count(" numsender: ", rlsstats.rli_numsender); + print_count(" nummap: ", rlsstats.rli_nummap); } } } diff -ur -ur globus_rls_server-4.9/db.c globus_rls_server-4.9/db.c --- globus_rls_server-4.9/db.c 2010-05-26 02:36:53.000000000 +0200 +++ globus_rls_server-4.9/db.c 2011-01-31 21:14:24.000000000 +0100 @@ -159,9 +159,8 @@ { db_handle_t *h; SQLRETURN r; + char buf[BIGBUF]; int connected = 0; - static int lrccounts = 0; - static int rlicounts = 0; SWORD len; int i; @@ -229,6 +228,15 @@ globus_mutex_unlock(&db_open_mtx); + if(ismysql) { + snprintf(buf, BIGBUF, "USE %s",dbname); + r = SQLExecDirect(h->stmt, (SQLCHAR *) buf, SQL_NTS); + if (!SQLNODATAOK(r)) { + odbcerr(r, SQL_HANDLE_DBC, h->dbc, errmsg); + goto error; + } + } + *hp = h; return GLOBUS_RLS_SUCCESS; debian/patches/globus-rls-server-deps.patch0000644000000000000000000000544511673064141016177 0ustar diff -ur globus_rls_server-4.9.orig/pkgdata/pkg_data_src.gpt.in globus_rls_server-4.9/pkgdata/pkg_data_src.gpt.in --- globus_rls_server-4.9.orig/pkgdata/pkg_data_src.gpt.in 2009-10-27 05:13:56.000000000 +0100 +++ globus_rls_server-4.9/pkgdata/pkg_data_src.gpt.in 2011-12-17 10:59:06.447439447 +0100 @@ -10,30 +10,30 @@ - + - + - + - - - + + + - + - + - + - - - + + + - + debian/patches/globus-rls-server-setup.patch0000644000000000000000000000075211406445443016402 0ustar diff -ur globus_rls_server_setup-4.5.orig/setup/setup-globus-rls-server globus_rls_server_setup-4.5/setup/setup-globus-rls-server --- globus_rls_server_setup-4.5.orig/setup/setup-globus-rls-server 2009-10-30 03:45:48.000000000 +0100 +++ globus_rls_server_setup-4.5/setup/setup-globus-rls-server 2010-01-23 12:45:22.250530487 +0100 @@ -7,4 +7,4 @@ fi . ${libexecdir}/globus-sh-tools.sh -perl ${prefix}/setup/globus/setup-globus-rls-server.pl +perl ${setupdir}/setup-globus-rls-server.pl debian/patches/series0000644000000000000000000000131311711207640012027 0ustar # Upstream changed the code without changing the version number # http://bugzilla.globus.org/bugzilla/show_bug.cgi?id=7074 globus-rls-server-gt502.patch globus-rls-server-gt503.patch globus-rls-server-gt504.patch # Dereferencing of type-punned pointers: # http://bugzilla.globus.org/bugzilla/show_bug.cgi?id=6607 globus-rls-server-type-punned-pointer.patch # Remove hardcoding of paths: # http://bugzilla.globus.org/bugzilla/show_bug.cgi?id=6595 globus-rls-server-setup.patch # Depend on GT 5.2.0 library versions globus-rls-server-deps.patch # Fix RLI updates for bloomfilters (from upstream CVS) globus-rls-server-bloomfilter.patch # Enable new threading (from upstream CVS) globus-rls-server-pthreads.patch debian/patches/globus-rls-server-gt504.patch0000644000000000000000000000132311572605526016104 0ustar diff -ur --exclude autom4te.cache --exclude CVS --exclude dirt.sh globus_rls_server-4.9/db.c globus_rls_server-4.9/db.c --- globus_rls_server-4.9/db.c 2011-01-31 21:14:24.000000000 +0100 +++ globus_rls_server-4.9/db.c 2011-04-21 23:27:45.000000000 +0200 @@ -159,7 +159,6 @@ { db_handle_t *h; SQLRETURN r; - char buf[BIGBUF]; int connected = 0; SWORD len; int i; @@ -228,15 +227,6 @@ globus_mutex_unlock(&db_open_mtx); - if(ismysql) { - snprintf(buf, BIGBUF, "USE %s",dbname); - r = SQLExecDirect(h->stmt, (SQLCHAR *) buf, SQL_NTS); - if (!SQLNODATAOK(r)) { - odbcerr(r, SQL_HANDLE_DBC, h->dbc, errmsg); - goto error; - } - } - *hp = h; return GLOBUS_RLS_SUCCESS; debian/patches/globus-rls-server-pthreads.patch0000644000000000000000000002410011711207302017032 0ustar diff -ur --exclude CVS globus_rls_server-4.9/event.c globus-rls-server-HEAD/event.c --- globus_rls_server-4.9/event.c 2007-06-13 20:34:32.000000000 +0200 +++ globus-rls-server-HEAD/event.c 2011-01-31 22:00:42.000000000 +0100 @@ -65,7 +65,7 @@ EVENT *p; EVENT *q; time_t now; - pthread_t thr; + globus_thread_t thr; int rc; if ((e = (EVENT *) globus_libc_malloc(sizeof(EVENT))) == NULL) { @@ -80,11 +80,8 @@ globus_cond_init(&e->ec.cond, GLOBUS_NULL); e->ec.flags = EF_RUNNING; - if ((rc = pthread_create(&thr, GLOBUS_NULL, e->fun, &e->ec)) != 0) - logit(LOG_WARNING, "event_process: pthread_create: %s", - globus_libc_system_error_string(rc)); - if ((rc = pthread_detach(thr)) != 0) - logit(LOG_WARNING, "event_process: pthread_detach: %s", + if ((rc = globus_thread_create(&thr, GLOBUS_NULL, e->fun, &e->ec)) != 0) + logit(LOG_WARNING, "event_process: globus_thread_create: %s", globus_libc_system_error_string(rc)); globus_mutex_lock(&eventmtx); diff -ur --exclude CVS globus_rls_server-4.9/lrc.c globus-rls-server-HEAD/lrc.c --- globus_rls_server-4.9/lrc.c 2010-05-26 02:36:53.000000000 +0200 +++ globus-rls-server-HEAD/lrc.c 2011-01-28 22:05:44.000000000 +0100 @@ -68,7 +68,15 @@ globus_bool_t lrc_init_done; } lrc_init_monitor_t; -static lrc_init_monitor_t lrc_init_monitor = { PTHREAD_MUTEX_INITIALIZER, GLOBUS_FALSE }; +static lrc_init_monitor_t lrc_init_monitor = { +#ifdef HAVE_PTHREAD + { .pthread = PTHREAD_MUTEX_INITIALIZER }, +#elif HAVE_WINDOWS_THREADS + { .windows = 0 }, +#else + { .none = 0 }, +#endif + GLOBUS_FALSE }; #ifdef COUNTUPDATE extern int updatebytes; @@ -265,7 +269,7 @@ ec->flags &= ~EF_RUNNING; globus_cond_signal(&ec->cond); globus_mutex_unlock(&ec->mtx); - pthread_exit(0); + globus_thread_exit(0); } else { ec->flags &= ~EF_RUN; globus_mutex_unlock(&ec->mtx); @@ -320,7 +324,7 @@ ec->flags &= ~EF_RUNNING; globus_cond_signal(&ec->cond); globus_mutex_unlock(&ec->mtx); - pthread_exit(0); + globus_thread_exit(0); } else { ec->flags &= ~EF_RUN; globus_mutex_unlock(&ec->mtx); @@ -425,7 +429,7 @@ globus_mutex_unlock(&ec->mtx); if (lrch) db_close(lrch); - pthread_exit(0); + globus_thread_exit(0); } else { ec->flags &= ~EF_RUN; globus_mutex_unlock(&ec->mtx); diff -ur --exclude CVS globus_rls_server-4.9/misc.c globus-rls-server-HEAD/misc.c --- globus_rls_server-4.9/misc.c 2008-12-12 23:52:59.000000000 +0100 +++ globus-rls-server-HEAD/misc.c 2011-01-28 22:05:44.000000000 +0100 @@ -134,11 +134,12 @@ va_list ap; char buf[BUFLEN]; char tbuf[100]; + globus_thread_t self = globus_thread_self(); va_start(ap, fmt); vsnprintf(buf, BUFLEN, fmt, ap); globus_logging_write(log_handle, level, - "T%lu: %s%s", (unsigned long int) pthread_self(), buf, + "T%lu: %s%s", (unsigned long int) self.dummy, buf, (detached)?"":"\n"); va_end(ap); } diff -ur --exclude CVS globus_rls_server-4.9/rli.c globus-rls-server-HEAD/rli.c --- globus_rls_server-4.9/rli.c 2010-05-26 02:36:53.000000000 +0200 +++ globus-rls-server-HEAD/rli.c 2011-01-28 22:05:44.000000000 +0100 @@ -259,7 +259,7 @@ if (!rli_bloomfilter) if (rlih) db_close(rlih); - pthread_exit(0); + globus_thread_exit(0); } else { ec->flags &= ~EF_RUN; globus_mutex_unlock(&ec->mtx); @@ -525,7 +525,7 @@ ec->flags &= ~EF_RUNNING; globus_cond_signal(&ec->cond); globus_mutex_unlock(&ec->mtx); - pthread_exit(0); + globus_thread_exit(0); } else { ec->flags &= ~EF_RUN; globus_mutex_unlock(&ec->mtx); @@ -584,7 +584,7 @@ ec->flags &= ~EF_RUNNING; globus_cond_signal(&ec->cond); globus_mutex_unlock(&ec->mtx); - pthread_exit(0); + globus_thread_exit(0); } else { ec->flags &= ~EF_RUN; globus_mutex_unlock(&ec->mtx); @@ -689,7 +689,7 @@ globus_mutex_unlock(&ec->mtx); if (rlih) db_close(rlih); - pthread_exit(0); + globus_thread_exit(0); } else { ec->flags &= ~EF_RUN; globus_mutex_unlock(&ec->mtx); diff -ur --exclude CVS globus_rls_server-4.9/server.c globus-rls-server-HEAD/server.c --- globus_rls_server-4.9/server.c 2009-11-13 19:17:29.000000000 +0100 +++ globus-rls-server-HEAD/server.c 2011-01-31 22:00:42.000000000 +0100 @@ -266,8 +266,8 @@ static int rrpc_success(CONNECTION *c); static void rrpc_flushio(CONNECTION *c); static int rrpc_readstr(CONNECTION *c, char *rbuf, int rbuflen); -static void hexitsig(int s); -static void hhupsig(int s); +static void hexitsig(void *s); +static void hhupsig(void *s); static void cleanexit(int s); static void usage(char *prog); static void usage_send_wrapper(); @@ -359,6 +359,7 @@ extern int optind; char *prog; int i; + int rc; globus_result_t r; globus_io_handle_t handle; char *s; @@ -369,7 +370,6 @@ int eventwaiting = 0; time_t now; static int backoff = 1; - struct sigaction sa; /* use this structure to pass the db_name, db_user and db_passwd to the lrc_init function through the pthread_create() function call. */ @@ -377,7 +377,7 @@ lrc_init_args_t lrc_init_params; /* the thread to create the lrc; */ - pthread_t lrc_thread; + globus_thread_t lrc_thread; /* the return value from the pthread_create call. This indicates if the thread was created successfully or not. However, it does not indicate if @@ -461,6 +461,12 @@ * If we detach after activating globus modules we get mysterious hangs * in globus_libc, so delay activation until after detaching. */ + rc = globus_thread_set_model("pthread"); + if (rc != GLOBUS_SUCCESS) + { + fprintf(stderr, "main: Unable to load pthread module\n"); + cleanexit(1); + } for (i = 0; i < NMODS; i++) if ((n = globus_module_activate(modules[i])) != GLOBUS_SUCCESS) { fprintf(stderr, "main: Unable to activate module %d error %d", i, n); @@ -477,15 +483,20 @@ if (!rlsdebug) writepid(prog); - sigemptyset(&sa.sa_mask); - sa.sa_flags = SA_RESTART; - sa.sa_handler = hexitsig; - for (i = 0; exitsigs[i]; i++) - sigaction(exitsigs[i], &sa, NULL); + { + globus_callback_register_signal_handler( + exitsigs[i], + GLOBUS_TRUE, + hexitsig, + &exitsigs[i]); + } - sa.sa_handler = hhupsig; - sigaction(SIGHUP, &sa, NULL); + globus_callback_register_signal_handler( + exitsigs[i], + GLOBUS_TRUE, + hhupsig, + NULL); init(); if ((r = startlistener((u_short) port, &handle)) != GLOBUS_SUCCESS) @@ -509,7 +520,7 @@ lrc_init_params.db_pwd = db_pwd; /* create the lrc server in a separate thread. */ - lrc_thread_rv = pthread_create(&lrc_thread, NULL, lrc_init, (void *) & lrc_init_params); + lrc_thread_rv = globus_thread_create(&lrc_thread, NULL, lrc_init, (void *) & lrc_init_params); /* note: only looks at return value of thread creation and not return value of lrc_init */ if (!lrc_thread_rv) { @@ -1008,7 +1019,7 @@ sigaddset(&ss, SIGHUP); for (i = 0; exitsigs[i]; i++) sigaddset(&ss, exitsigs[i]); - pthread_sigmask(SIG_BLOCK, &ss, NULL); + globus_thread_sigmask(SIG_BLOCK, &ss, NULL); while (1) { globus_mutex_lock(&reqqueuemtx); @@ -1268,7 +1279,7 @@ ec->flags &= ~EF_RUNNING; globus_cond_signal(&ec->cond); globus_mutex_unlock(&ec->mtx); - pthread_exit(0); + globus_thread_exit(0); } else { ec->flags &= ~EF_RUN; globus_mutex_unlock(&ec->mtx); @@ -3520,16 +3531,13 @@ { int rc; - pthread_t thr; + globus_thread_t thr; - if ((rc = pthread_create(&thr, GLOBUS_NULL, procreq, NULL)) != 0) { - logit(LOG_WARNING, "pthread_create: %s", + if ((rc = globus_thread_create(&thr, GLOBUS_NULL, procreq, NULL)) != 0) { + logit(LOG_WARNING, "globus_thread_create: %s", globus_libc_system_error_string(rc)); return 0; } - if ((rc = pthread_detach(thr)) != 0) - logit(LOG_WARNING, "pthread_detach: %s", - globus_libc_system_error_string(rc)); globus_mutex_lock(&commonmtx); numthreads++; if (loglevel) @@ -3553,16 +3561,16 @@ if (quitting && numthreads == 0) /* If last thread let parent */ globus_cond_signal(&commoncond); /* know they're all dead */ globus_mutex_unlock(&commonmtx); - pthread_exit(0); + globus_thread_exit(0); } static void -hexitsig(int s) +hexitsig(void * s) { if (quitting++) return; - logit(LOG_INFO, "hexitsig: Received signal %d", s); + logit(LOG_INFO, "hexitsig: Received signal %d", *(int *) s); /* * Would like to signal commoncond but can't call pthread_cond_signal * safely from async signal handler on linux. Main loop wakes up @@ -3571,7 +3579,7 @@ } static void -hhupsig(int s) +hhupsig(void * s) { if (needreadconf++) diff -ur --exclude CVS globus_rls_server-4.9/update.c globus-rls-server-HEAD/update.c --- globus_rls_server-4.9/update.c 2007-06-15 05:27:29.000000000 +0200 +++ globus-rls-server-HEAD/update.c 2011-01-31 22:00:42.000000000 +0100 @@ -373,7 +373,7 @@ RLI **rlilistp = (RLI **) a; RLI *rli = NULL; UPDATEPAT *p = NULL; - pthread_t thr; + globus_thread_t thr; int rc; int dbflags; @@ -422,14 +422,11 @@ if (dbflags & FRLI_BLOOMFILTER) rli->flags |= FR_BLOOMFILTER; else { - if ((rc = pthread_create(&thr, GLOBUS_NULL, process_update, rli)) != 0){ - logit(LOG_WARNING, "rlilistcb: pthread_create: %s", + if ((rc = globus_thread_create(&thr, GLOBUS_NULL, process_update, rli)) != 0){ + logit(LOG_WARNING, "rlilistcb: globus_thread_create: %s", globus_libc_system_error_string(rc)); - goto error; + goto error; } - if ((rc = pthread_detach(thr)) != 0) - logit(LOG_INFO, "rlilistcb: pthread_detach: %s", - globus_libc_system_error_string(rc)); } rli->nxt = *rlilistp; *rlilistp = rli; @@ -603,7 +600,7 @@ globus_mutex_unlock(&rli->mtx); if (loglevel) logit(LOG_DEBUG, "process_update(%s): End thread", rli->url); - pthread_exit(0); + globus_thread_exit(0); } } } debian/patches/globus-rls-server-bloomfilter.patch0000644000000000000000000001404711711207302017547 0ustar diff -ur --exclude CVS globus_rls_server-4.9/server.c globus-rls-server-B5.0/server.c --- globus_rls_server-4.9/server.c 2009-11-13 19:17:29.000000000 +0100 +++ globus-rls-server-B5.0/server.c 2012-01-27 01:02:01.000000000 +0100 @@ -166,6 +166,7 @@ static int listresult(void *cv, char *s1, char *s2, char *s3, char *s4, int irc); static int getreslimit(char *areslimit); +static void bfresize(DBH *dbh); METHOD methods[] = { { "admin", rls_admin, 1, 0, 0 }, @@ -207,7 +208,7 @@ { "lrc_rli_get_part", lrc_rli_get_part, 2, P_LRCREAD, MF_NEEDLRC }, { "lrc_rli_info", lrc_rli_info, 1, P_LRCREAD, MF_NEEDLRC }, { "lrc_rli_list", lrc_rli_list, 0, P_LRCREAD, MF_NEEDLRC }, - { "rli_exists", rli_exists, 2, P_RLIREAD, MF_NEEDLRC }, + { "rli_exists", rli_exists, 2, P_RLIREAD, MF_NEEDRLI }, { "rli_exists_bulk", rli_exists_bulk, 0, P_RLIREAD, MF_NEEDRLI }, { "rli_get_lrc", rli_get_lrc, 3, P_RLIREAD, MF_NEEDRLI }, { "rli_get_lrc_bulk", rli_get_lrc_bulk, 0, P_RLIREAD, MF_NEEDRLI }, @@ -1885,7 +1886,7 @@ c->errmsg)) != GLOBUS_RLS_SUCCESS) { rrpc_error(c, rc, "%s", c->errmsg); return; - } else if (rc == GLOBUS_RLS_SUCCESS) { + } else { if (bloomfilter.bfsize) { globus_mutex_lock(&bloomfilter.mtx); bf_addlfn(&bloomfilter, arglist[0]); @@ -1894,21 +1895,11 @@ } rrpc_success(c); - if (update_immediate) - doimmediate(rliop_add, lrc_rlilist, &lrc_rlilistlock, arglist[0], NULL); - /* - * If we're using bloom filters to update, and the number of lfns has - * doubled in the db, then resize the bloom filter. - */ - if (bloomfilter.bfsize && - (table[T_LRCLFN].count >= bloomfilter.startlfns * 2) && - (table[T_LRCLFN].count * lrc_bloomfilter_ratio > bloomfilter.bfsize)) { - if (loglevel) - logit(LOG_DEBUG, "lrc_create: Resizing bloom filter, current %d new %d", - bloomfilter.bfsize, table[T_LRCLFN].count * lrc_bloomfilter_ratio); - bf_free(&bloomfilter); - bloomfilter.startlfns = table[T_LRCLFN].count; - lrc_getbf(dbh->lrc); + if (rc == GLOBUS_RLS_SUCCESS) { + if (update_immediate) + doimmediate(rliop_add, lrc_rlilist, &lrc_rlilistlock, arglist[0], NULL); + + bfresize(dbh); } } @@ -1935,10 +1926,21 @@ } if ((rc = db_lrc_create(dbh->lrc,lfn,pfn,c->errmsg)) != GLOBUS_RLS_SUCCESS) listresult(c, lfn, pfn, NULL, NULL, rc); - else if (update_immediate) - doimmediate(rliop_add, lrc_rlilist, &lrc_rlilistlock, lfn, NULL); + else { + if (bloomfilter.bfsize) { + globus_mutex_lock(&bloomfilter.mtx); + bf_addlfn(&bloomfilter, lfn); + globus_mutex_unlock(&bloomfilter.mtx); + } + if (update_immediate) + doimmediate(rliop_add, lrc_rlilist, &lrc_rlilistlock, lfn, NULL); + } } endstrcb(c, 0); + + /* Resize bf, if needed */ + bfresize(dbh); + if (loglevel > 1) logit(LOG_DEBUG, "lrc_create_bulk: end"); } @@ -1948,7 +1950,7 @@ { int rc; - int lfndeleted; + int lfndeleted = 0; if (!arglist[0] || !arglist[1]) { rrpc_error(c, GLOBUS_RLS_BADARG, ""); @@ -1958,7 +1960,7 @@ &lfndeleted, c->errmsg)) != GLOBUS_RLS_SUCCESS) { rrpc_error(c, rc, "%s", c->errmsg); return; - } else if (lfndeleted && rc == GLOBUS_RLS_SUCCESS) { + } else if (lfndeleted) { if (bloomfilter.bfsize) { globus_mutex_lock(&bloomfilter.mtx); bf_deletelfn(&bloomfilter, arglist[0]); @@ -1978,7 +1980,7 @@ int rc; char lfn[BUFLEN]; char pfn[BUFLEN]; - int lfndeleted; + int lfndeleted = 0; if (loglevel > 1) logit(LOG_DEBUG, "lrc_delete_bulk:"); @@ -1996,8 +1998,15 @@ if ((rc = db_lrc_delete(dbh->lrc, lfn, pfn, &lfndeleted, c->errmsg)) != GLOBUS_RLS_SUCCESS) listresult(c, lfn, pfn, NULL, NULL, rc); - else if (update_immediate && lfndeleted) - doimmediate(rliop_delete, lrc_rlilist, &lrc_rlilistlock, lfn, NULL); + else if (lfndeleted) { + if (bloomfilter.bfsize) { + globus_mutex_lock(&bloomfilter.mtx); + bf_deletelfn(&bloomfilter, lfn); + globus_mutex_unlock(&bloomfilter.mtx); + } + if (update_immediate) + doimmediate(rliop_delete, lrc_rlilist, &lrc_rlilistlock, lfn, NULL); + } } endstrcb(c, 0); if (loglevel > 1) @@ -2298,10 +2307,18 @@ } if ((rc = db_lrc_renamelfn(dbh->lrc,oldname,newname,c->errmsg)) != GLOBUS_RLS_SUCCESS) listresult(c, oldname, newname, NULL, NULL, rc); - else if (update_immediate) { - doimmediate(rliop_delete, lrc_rlilist, &lrc_rlilistlock, oldname, NULL); - doimmediate(rliop_add, lrc_rlilist, &lrc_rlilistlock, newname, NULL); - } + else { + if (bloomfilter.bfsize) { + globus_mutex_lock(&bloomfilter.mtx); + bf_deletelfn(&bloomfilter, oldname); + bf_addlfn(&bloomfilter, newname); + globus_mutex_unlock(&bloomfilter.mtx); + } + if (update_immediate) { + doimmediate(rliop_delete, lrc_rlilist, &lrc_rlilistlock, oldname, NULL); + doimmediate(rliop_add, lrc_rlilist, &lrc_rlilistlock, newname, NULL); + } + } } endstrcb(c, 0); if (loglevel > 1) @@ -2527,8 +2544,10 @@ break; } rls_lock_release(&senderlistlock, readlock); - if (!sender) + if (!sender) { rrpc_error(c, nferr, "%s", arglist[0]); + return; + } } else { if ((rc = db_exists(dbh->rli, arglist[0], objtype, c->errmsg)) != GLOBUS_RLS_SUCCESS) { @@ -3513,6 +3532,26 @@ } /* + * If we're using bloom filters to update, and the number of lfns has + * doubled in the db, then resize the bloom filter. + */ +static void +bfresize(DBH *dbh) +{ + if (bloomfilter.bfsize && + (table[T_LRCLFN].count >= bloomfilter.startlfns * 2) && + (table[T_LRCLFN].count * lrc_bloomfilter_ratio > bloomfilter.bfsize)) { + if (loglevel) + logit(LOG_DEBUG, "bfresize: Resizing bloom filter, current %d new %d", + bloomfilter.bfsize, table[T_LRCLFN].count * lrc_bloomfilter_ratio); + bf_free(&bloomfilter); + bloomfilter.startlfns = table[T_LRCLFN].count; + lrc_getbf(dbh->lrc); + } + return; +} + +/* * Start up thread to process requests. */ static int debian/patches/globus-rls-server-type-punned-pointer.patch0000644000000000000000000000206711406445443021171 0ustar diff -ur globus_rls_server-4.7.orig/db.c globus_rls_server-4.7/db.c --- globus_rls_server-4.7.orig/db.c 2007-11-10 03:08:06.000000000 +0100 +++ globus_rls_server-4.7/db.c 2008-12-30 20:55:10.000000000 +0100 @@ -1950,13 +1950,13 @@ * We're adding a new mapping, so increment ref counts on lfn, lrc and * sender, or create if they don't exist. */ - if ((rc = updateref(h, T_RLILFN, lfn, 1, 1, (SQLINTEGER *) &lfn_id, NULL, + if ((rc = updateref(h, T_RLILFN, lfn, 1, 1, (SQLINTEGER *) (void *) &lfn_id, NULL, errmsg, adjcount)) != GLOBUS_RLS_SUCCESS) goto error; - if ((rc = updateref(h, T_RLILRC, lrc, 1, 1, (SQLINTEGER *) &lrc_id, NULL, + if ((rc = updateref(h, T_RLILRC, lrc, 1, 1, (SQLINTEGER *) (void *) &lrc_id, NULL, errmsg, adjcount)) != GLOBUS_RLS_SUCCESS) goto error; - if ((rc = updateref(h, T_RLISENDER, sender, 1, 1, (SQLINTEGER *) &sender_id, NULL, + if ((rc = updateref(h, T_RLISENDER, sender, 1, 1, (SQLINTEGER *) (void *) &sender_id, NULL, errmsg, adjcount)) != GLOBUS_RLS_SUCCESS) goto error; debian/patches/globus-rls-server-gt502.patch0000644000000000000000000001153411421031652016071 0ustar diff globus_rls_server-4.9/db.c globus_rls_server-4.9/db.c --- globus_rls_server-4.9/db.c 2009-10-23 03:28:37.000000000 +0200 +++ globus_rls_server-4.9/db.c 2010-05-26 02:36:53.000000000 +0200 @@ -72,12 +72,6 @@ int *nferr); static char *valuetype2table(globus_rls_attr_type_t type); -typedef struct { - SQLHENV env; - HDBC dbc; - SQLHSTMT stmt; -} db_handle_t; - #define IDLISTSIZE 10000 typedef struct idlist_ { SQLINTEGER ids[IDLISTSIZE]; @@ -100,7 +94,7 @@ static int updateref(db_handle_t *h, int tidx, char *name, int adjust, int insert, SQLINTEGER *id, SQLINTEGER *ref, char *errmsg, int *adjcount); -static void gettablecount(db_handle_t *h, int tidx); +void gettablecount(db_handle_t *h, int tidx); static SQLRETURN deleteattrvals(db_handle_t *h, globus_rls_obj_type_t objtype, SQLINTEGER obj_id); static int attrinfo(db_handle_t *h, globus_rls_obj_type_t objtype, @@ -131,17 +125,18 @@ * T_xxx defines in db.h. */ TABLE table[] = { - { "t_lfn", GLOBUS_RLS_LFN_NEXIST, 0 }, - { "t_pfn", GLOBUS_RLS_PFN_NEXIST, 0 }, - { "t_map", GLOBUS_RLS_MAPPING_NEXIST, 0 }, - { "t_lfn", GLOBUS_RLS_LFN_NEXIST, 0 }, - { "t_lrc", GLOBUS_RLS_LRC_NEXIST, 0 }, - { "t_sender", GLOBUS_RLS_LRC_NEXIST, 0 }, - { "t_map", GLOBUS_RLS_MAPPING_NEXIST, 0 }, + { "t_lfn", GLOBUS_RLS_LFN_NEXIST, -1 }, + { "t_pfn", GLOBUS_RLS_PFN_NEXIST, -1 }, + { "t_map", GLOBUS_RLS_MAPPING_NEXIST, -1 }, + { "t_lfn", GLOBUS_RLS_LFN_NEXIST, -1 }, + { "t_lrc", GLOBUS_RLS_LRC_NEXIST, -1 }, + { "t_sender", GLOBUS_RLS_LRC_NEXIST, -1 }, + { "t_map", GLOBUS_RLS_MAPPING_NEXIST, -1 }, }; #define T_NUM (sizeof(table) / sizeof(TABLE)) -static globus_mutex_t tablemtx; +globus_mutex_t tablemtx; +static globus_mutex_t db_open_mtx; static char dbmsname[256]; static int firsttime = 1; @@ -210,7 +205,7 @@ goto error; } - globus_mutex_lock(&tablemtx); + globus_mutex_lock(&db_open_mtx); if (firsttime) { firsttime = 0; r = SQLGetInfo(h->dbc, SQL_DBMS_NAME, dbmsname, sizeof(dbmsname), &len); @@ -232,21 +227,7 @@ } } - if (lrc_server) { - if (lrccounts++ == 0) { - gettablecount(h, T_LRCLFN); - gettablecount(h, T_LRCPFN); - gettablecount(h, T_LRCMAP); - } - } else { - if (rlicounts++ == 0) { - gettablecount(h, T_RLILFN); - gettablecount(h, T_RLILRC); - gettablecount(h, T_RLISENDER); - gettablecount(h, T_RLIMAP); - } - } - globus_mutex_unlock(&tablemtx); + globus_mutex_unlock(&db_open_mtx); *hp = h; return GLOBUS_RLS_SUCCESS; @@ -2294,7 +2275,7 @@ /* * Get size of table. table[] should already be locked. */ -static void +void gettablecount(db_handle_t *h, int tidx) { diff -ur globus_rls_server-4.9/db.h globus_rls_server-4.9/db.h --- globus_rls_server-4.9/db.h 2009-10-26 21:59:34.000000000 +0100 +++ globus_rls_server-4.9/db.h 2010-05-26 02:36:53.000000000 +0200 @@ -19,6 +19,9 @@ * by a query (see db schema files), plus one for terminating null byte. */ #define MAXDBSTR (500+1) +# include + +extern globus_mutex_t tablemtx; typedef globus_bool_t (*db_str1_callback_t) ( void *a, @@ -51,6 +54,12 @@ int count; /* Count of records in table */ } TABLE; +typedef struct { + SQLHENV env; + HDBC dbc; + SQLHSTMT stmt; +} db_handle_t; + /* * These defines are indexes into table[] array in db.c. */ @@ -137,3 +146,4 @@ char *errmsg); extern int db_rli_update(void *hv, char *lfn, char *lrc, char *sender, char *ts, int *lfnchanged, char *errmsg); +extern void gettablecount(db_handle_t *h, int tidx); diff -ur globus_rls_server-4.9/lrc.c globus_rls_server-4.9/lrc.c --- globus_rls_server-4.9/lrc.c 2009-10-16 01:59:59.000000000 +0200 +++ globus_rls_server-4.9/lrc.c 2010-05-26 02:36:53.000000000 +0200 @@ -110,6 +110,13 @@ logit(LOG_WARNING, "lrc_init(%s): %s", lrc_dbname, errbuf); return rc; } + + globus_mutex_lock(&tablemtx); + gettablecount(lrch, T_LRCLFN); + gettablecount(lrch, T_LRCPFN); + gettablecount(lrch, T_LRCMAP); + globus_mutex_unlock(&tablemtx); + update_readrli(lrch, &lrc_rlilistlock, &lrc_rlilist); rls_lock_get(&lrc_rlilistlock, readlock); for (rli = lrc_rlilist; rli; rli = rli->nxt) diff -ur globus_rls_server-4.9/rli.c globus_rls_server-4.9/rli.c --- globus_rls_server-4.9/rli.c 2007-06-15 05:27:29.000000000 +0200 +++ globus_rls_server-4.9/rli.c 2010-05-26 02:36:53.000000000 +0200 @@ -94,7 +94,13 @@ if (db_open(dbname, db_user, db_pwd, 0, &rlih, errbuf) != GLOBUS_RLS_SUCCESS) logit(LOG_WARNING, "rli_init(%s): %s", dbname, errbuf); else { - update_readrli(rlih, &rli_rlilistlock, &rli_rlilist); + globus_mutex_lock(&tablemtx); + gettablecount(rlih, T_RLILFN); + gettablecount(rlih, T_RLILRC); + gettablecount(rlih, T_RLISENDER); + gettablecount(rlih, T_RLIMAP); + globus_mutex_unlock(&tablemtx); + update_readrli(rlih, &rli_rlilistlock, &rli_rlilist); db_close(rlih); } debian/changelog0000644000000000000000000000646312240120212011033 0ustar globus-rls-server (4.9-13) unstable; urgency=low * Implement Multi-Arch support -- Mattias Ellert Mon, 11 Nov 2013 10:05:26 +0100 globus-rls-server (4.9-12) unstable; urgency=low * Add arm64 to the list of 64 bit architectures -- Mattias Ellert Sun, 26 May 2013 20:14:35 +0200 globus-rls-server (4.9-11) unstable; urgency=low * Fix RLI updates for bloomfilters (from upstream CVS) (Closes: #657650) -- Mattias Ellert Sun, 29 Jan 2012 10:24:05 +0100 globus-rls-server (4.9-10) unstable; urgency=low * debian/rules cleanup -- Mattias Ellert Tue, 24 Jan 2012 20:22:44 +0100 globus-rls-server (4.9-9) unstable; urgency=low * Enable pthreads * Fix broken links in README file -- Mattias Ellert Tue, 17 Jan 2012 23:36:57 +0100 globus-rls-server (4.9-8) unstable; urgency=low * Recompile for Globus Toolkit 5.2.0 -- Mattias Ellert Thu, 29 Dec 2011 10:42:45 +0100 globus-rls-server (4.9-7) unstable; urgency=low * Update start-up script -- Mattias Ellert Sun, 02 Oct 2011 20:19:57 +0200 globus-rls-server (4.9-6) unstable; urgency=low * Update to Globus Toolkit 5.0.4 * Drop patch globus-rls-server-db.patch (fixed upstream) -- Mattias Ellert Mon, 06 Jun 2011 13:00:06 +0200 globus-rls-server (4.9-5) unstable; urgency=low * Add README file * Revert broken mysql change from upsream -- Mattias Ellert Tue, 26 Apr 2011 19:20:14 +0200 globus-rls-server (4.9-4) unstable; urgency=low * Update to Globus Toolkit 5.0.3 -- Mattias Ellert Sat, 26 Feb 2011 15:56:51 +0100 globus-rls-server (4.9-3) unstable; urgency=low * Update to Globus Toolkit 5.0.2 -- Mattias Ellert Mon, 19 Jul 2010 13:07:50 +0200 globus-rls-server (4.9-2) unstable; urgency=low * Converting to package format 3.0 (quilt) -- Mattias Ellert Fri, 04 Jun 2010 04:43:30 +0200 globus-rls-server (4.9-1) unstable; urgency=low * Update to Globus Toolkit 5.0.0 * Add debug package -- Mattias Ellert Wed, 27 Jan 2010 11:31:12 +0100 globus-rls-server (4.7-5) unstable; urgency=low * Remove the SXXrls.in file * Remove hardcoded port number in init.d startup script -- Mattias Ellert Mon, 08 Jun 2009 20:44:58 +0200 globus-rls-server (4.7-4) unstable; urgency=low * Fix rule dependencies in the debian/rules file. -- Mattias Ellert Wed, 13 May 2009 23:12:37 +0200 globus-rls-server (4.7-3) unstable; urgency=low * Initial release (Closes: #514487). * Rebuilt to correct libltdl dependency. * Preparing for other 64bit platforms than amd64. -- Mattias Ellert Sat, 18 Apr 2009 20:17:35 +0200 globus-rls-server (4.7-2) UNRELEASED; urgency=low * Only quote the Apache-2.0 license if necessary. -- Mattias Ellert Thu, 26 Mar 2009 09:21:25 +0100 globus-rls-server (4.7-1) UNRELEASED; urgency=low * First build. -- Mattias Ellert Sat, 03 Jan 2009 17:36:07 +0100 debian/source/0000755000000000000000000000000011677033025010472 5ustar debian/source/format0000644000000000000000000000001411677033025011700 0ustar 3.0 (quilt)