Updated patch for LB deployment module (contains LB&JP changes and build workarounds...
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 3 Apr 2006 19:18:17 +0000 (19:18 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 3 Apr 2006 19:18:17 +0000 (19:18 +0000)
org.glite.lb/deployment/README
org.glite.lb/deployment/deploy_lb.diff

index 630889d..ad8d2ee 100644 (file)
@@ -1,2 +1,3 @@
-deploy_lb - against glite-deployment-lb_R_2_1_2
+deploy_lb - against glite-deployment-lb_R_2_1_2 (with not commited changes to
+            LB/JP and deployment build workarounds)
 deploy_jp - against HEAD
index f6b5b76..ee94a70 100644 (file)
@@ -1,10 +1,10 @@
 Index: org.glite.deployment.lb/config/scripts/glite-lb-config.py
 ===================================================================
 RCS file: /cvs/jra1mw/org.glite.deployment.lb/config/scripts/glite-lb-config.py,v
-retrieving revision 1.66
-diff -u -r1.66 glite-lb-config.py
---- org.glite.deployment.lb/config/scripts/glite-lb-config.py  13 Mar 2006 15:22:31 -0000      1.66
-+++ org.glite.deployment.lb/config/scripts/glite-lb-config.py  15 Mar 2006 14:51:40 -0000
+retrieving revision 1.63.2.8
+diff -u -r1.63.2.8 glite-lb-config.py
+--- org.glite.deployment.lb/config/scripts/glite-lb-config.py  22 Feb 2006 00:12:59 -0000      1.63.2.8
++++ org.glite.deployment.lb/config/scripts/glite-lb-config.py  3 Apr 2006 18:59:49 -0000
 @@ -120,7 +120,12 @@
  
          if not os.path.exists('/tmp/mysql.sock'):
@@ -113,7 +113,7 @@ diff -u -r1.66 glite-lb-config.py
          #-------------------------------------------------------------------
          # Servicetool
          #-------------------------------------------------------------------
-@@ -325,7 +387,27 @@
+@@ -325,7 +387,29 @@
              print "\n==> MySQL database %s already exist\n" % params['lb.database.name']
              
          self.mysql.stop()
@@ -126,7 +126,7 @@ diff -u -r1.66 glite-lb-config.py
 +          file = open('%s/etc/glite-lb-export-cron-wrapper.sh' % os.environ['GLITE_LOCATION'], 'w')
 +          file.write('#! /bin/sh\n')
 +          file.write('. %s\n' % glib.getInstallerExportFile())
-+            file.write('$GLITE_LOCATION/examples/glite-lb-export.sh\n')
++            file.write('$GLITE_LOCATION/sbin/glite-lb-export.sh\n')
 +          file.close()
 +            os.system('/bin/chmod 0755 %s/etc/glite-lb-export-cron-wrapper.sh' % os.environ['GLITE_LOCATION'])
 +
@@ -135,6 +135,8 @@ diff -u -r1.66 glite-lb-config.py
 +          file.write('00,30 * * * * %s %s/etc/glite-lb-export-cron-wrapper.sh\n' % (params['glite.user.name'], os.environ['GLITE_LOCATION']))
 +          file.close()
 +            os.system('/bin/chmod 0755 /etc/cron.d/glite-lb-export.cron')
++      else:
++            os.system('/bin/rm -f /etc/cron.d/glite-lb-export.cron')
 +
 +            # Touch cron spool directory to cause reloading of the crontabs
 +            os.system("/bin/touch /var/spool/cron")
@@ -142,19 +144,19 @@ diff -u -r1.66 glite-lb-config.py
          #-------------------------------------------------------------------
          # RGMA servicetool: configure servicetool
          #-------------------------------------------------------------------
-@@ -411,6 +493,17 @@
+@@ -411,6 +495,17 @@
      # Perl
      glib.addEnvPath("PERL5LIB", "%s/lib/perl:%s/lib/perl5" % (os.environ['GPT_LOCATION'],os.environ['GLITE_LOCATION']))
  
 +    # LB export
 +    glib.export('GLITE_LB_EXPORT_ENABLED', params['lb.export.enabled']);
-+    glib.export('GLITE_LB_EXPORT_BKSERVER', params['lb.export.bkserver']);
 +    glib.export('GLITE_LB_EXPORT_JPPS', params['lb.export.jpps']);
 +    glib.export('GLITE_LB_EXPORT_JPREG_MAILDIR', params['lb.export.jpreg']);
 +    glib.export('GLITE_LB_EXPORT_JPDUMP_MAILDIR', params['lb.export.jpdump']);
 +    glib.export('GLITE_LB_EXPORT_DUMPDIR', params['lb.export.dump']);
-+    glib.export('GLITE_LB_EXPORT_DUMPDIR_OLD', params['lb.export.dump.old']);
-+    glib.export('GLITE_LB_EXPORT_EXPORTDIR', params['lb.export.export']);
++    glib.export('GLITE_LB_EXPORT_DUMPDIR_KEEP', params['lb.export.dump.keep']);
++    glib.export('GLITE_LB_EXPORT_JOBSDIR', params['lb.export.jobs']);
++    glib.export('GLITE_LB_EXPORT_JOBSDIR_KEEP', params['lb.export.jobs.keep']);
 +    glib.export('GLITE_LB_EXPORT_PURGE_ARGS', '"%s"' % params['lb.export.purgeargs']);
 +
      # Set environment
@@ -163,10 +165,10 @@ diff -u -r1.66 glite-lb-config.py
 Index: org.glite.deployment.lb/config/templates/glite-lb.cfg.xml
 ===================================================================
 RCS file: /cvs/jra1mw/org.glite.deployment.lb/config/templates/glite-lb.cfg.xml,v
-retrieving revision 1.21
-diff -u -r1.21 glite-lb.cfg.xml
---- org.glite.deployment.lb/config/templates/glite-lb.cfg.xml  13 Mar 2006 15:19:21 -0000      1.21
-+++ org.glite.deployment.lb/config/templates/glite-lb.cfg.xml  15 Mar 2006 14:51:40 -0000
+retrieving revision 1.20.2.5
+diff -u -r1.20.2.5 glite-lb.cfg.xml
+--- org.glite.deployment.lb/config/templates/glite-lb.cfg.xml  22 Feb 2006 00:12:58 -0000      1.20.2.5
++++ org.glite.deployment.lb/config/templates/glite-lb.cfg.xml  3 Apr 2006 18:59:49 -0000
 @@ -17,9 +17,16 @@
                        parameter. Leave it empty of comment it out to use the same as 'glite.user.name'"
                        value="changeme"/>
@@ -206,40 +208,40 @@ diff -u -r1.21 glite-lb.cfg.xml
                </lb.index.list>
 -                      
 +
-+              <lb.export.bkserver
-+                      description="Book Keeping Server service when differs from default port on localhost.
-+                              [Example: localhost:9000][Type: string]"
-+                      value=""/>
-+
 +              <lb.export.jpreg
-+                      description="Maildir for job registrations.
-+                              [Example: /tmp/jpreg][Type: string]"
-+                      value=""/>
++                      description="Spool directory where job registration requests are stored before delivered to JPPS.
++                              [Type: string]"
++                      value="/tmp/jpreg"/>
 +
 +              <lb.export.jpdump
-+                      description="Maildir for job dumps.
-+                              [Example: /tmp/jpdump][Type: string]"
-+                      value=""/>
++                      description="Spool directory where dump upload requests are stored before delivered to JPPS.
++                              [Type: string]"
++                      value="/tmp/jpdump"/>
 +
 +              <lb.export.dump
 +                      description="Dump directory for purged jobs.
-+                              [Example: /tmp/dump][Type: string]"
-+                      value=""/>
++                              [Type: string]"
++                      value="/tmp/dump"/>
 +
-+              <lb.export.dump.old
++              <lb.export.dump.keep
 +                      description="Dump directory for handled purged jobs.
-+                              [Example: /tmp/dump.old][Type: string]"
++                              [Example: /tmp/dump.keep][Type: string]"
 +                      value=""/>
 +
-+              <lb.export.export
-+                      description="Exported events divided to file per job.
-+                              [Example: /tmp/lb_export][Type: string]"
++              <lb.export.jobs
++                      description="Exported events divided to file per job before delivered to JPPS.
++                              [Type: string]"
++                      value="/tmp/lb_export"/>
++
++              <lb.export.jobs.keep
++                      description="Keep the exported events.
++                              [Example: /tmp/lb_export.keep][Type: string]"
 +                      value=""/>
 +
 +              <lb.export.purgeargs
 +                      description="Purge arguments (with timeouts).
 +                              [Example: -a 1h -c 1h -n 1h -o 1d][Type: string]"
-+                      value="-a 1d -c 1d -n 1d -o 7d"/>
++                      value="--aborted 1d --cleared 1d --cancelled 1d --other 7d"/>
 +
        </parameters>
  
@@ -247,10 +249,10 @@ diff -u -r1.21 glite-lb.cfg.xml
 Index: org.glite.deployment.lb/project/glite-lb.sdf.xml.template
 ===================================================================
 RCS file: /cvs/jra1mw/org.glite.deployment.lb/project/glite-lb.sdf.xml.template,v
-retrieving revision 1.38
-diff -u -r1.38 glite-lb.sdf.xml.template
---- org.glite.deployment.lb/project/glite-lb.sdf.xml.template  13 Mar 2006 15:19:21 -0000      1.38
-+++ org.glite.deployment.lb/project/glite-lb.sdf.xml.template  15 Mar 2006 14:51:40 -0000
+retrieving revision 1.37.2.3
+diff -u -r1.37.2.3 glite-lb.sdf.xml.template
+--- org.glite.deployment.lb/project/glite-lb.sdf.xml.template  8 Jan 2006 16:44:58 -0000       1.37.2.3
++++ org.glite.deployment.lb/project/glite-lb.sdf.xml.template  3 Apr 2006 18:59:49 -0000
 @@ -57,6 +57,12 @@
                                        build="@org.glite.lb.server-bones.info.build@"
                                        arch="i386"/>
@@ -277,3 +279,390 @@ diff -u -r1.38 glite-lb.sdf.xml.template
                  <component name="gridsite"
                      version="@org.gridsite.core.info.version@"
                      age="@org.gridsite.core.info.age@"
+Index: org.glite.deployment.lb/project/properties.xml
+===================================================================
+RCS file: /cvs/jra1mw/org.glite.deployment.lb/project/properties.xml,v
+retrieving revision 1.2.4.1
+diff -u -r1.2.4.1 properties.xml
+--- org.glite.deployment.lb/project/properties.xml     27 Nov 2005 16:16:17 -0000      1.2.4.1
++++ org.glite.deployment.lb/project/properties.xml     3 Apr 2006 18:59:49 -0000
+@@ -65,5 +65,7 @@
+ %attr(644,root,root) %{prefix}/share/doc/glite-lb/release_notes/release_notes.pdf\n
+ %attr(644,root,root) %{prefix}/share/doc/glite-lb/release_notes/release_notes.html\n"
+       />
++      <property name="build.package.name" value="glite-lb-config" />
++      <property name="build.package.prefix" value="glite-lb" />
+ </project>
+Index: org.glite.deployment.rgma-servicetool/project/properties.xml
+===================================================================
+RCS file: /cvs/jra1mw/org.glite.deployment.rgma-servicetool/project/properties.xml,v
+retrieving revision 1.3.4.1
+diff -u -r1.3.4.1 properties.xml
+--- org.glite.deployment.rgma-servicetool/project/properties.xml       17 Nov 2005 16:15:16 -0000      1.3.4.1
++++ org.glite.deployment.rgma-servicetool/project/properties.xml       3 Apr 2006 18:59:49 -0000
+@@ -71,5 +71,7 @@
+ %attr(644,root,root) %{prefix}/share/doc/glite-rgma-servicetool/release_notes/release_notes.doc\n
+ %attr(644,root,root) %{prefix}/share/doc/glite-rgma-servicetool/release_notes/release_notes.pdf\n
+ %attr(644,root,root) %{prefix}/share/doc/glite-rgma-servicetool/release_notes/release_notes.html" />
+-               
++
++<property name="build.package.name" value="glite-rgma-servicetool-config" />
++<property name="build.package.prefix" value="glite-rgma-servicetool" />
+ </project>
+Index: org.glite.jp.client/config/startup
+===================================================================
+RCS file: /cvs/jra1mw/org.glite.jp.client/config/startup,v
+retrieving revision 1.2
+diff -u -r1.2 startup
+--- org.glite.jp.client/config/startup 31 Mar 2006 09:02:19 -0000      1.2
++++ org.glite.jp.client/config/startup 3 Apr 2006 18:59:49 -0000
+@@ -41,10 +41,14 @@
+       jpdump_maildir="--dump-mdir $GLITE_LB_EXPORT_JPDUMP_MAILDIR "
+       [ -d "$GLITE_LB_EXPORT_JPDUMP_MAILDIR" ] || mkdir "$GLITE_LB_EXPORT_JPDUMP_MAILDIR" && chown $GLITE_USER:$GLITE_GROUP "$GLITE_LB_EXPORT_JPDUMP_MAILDIR"
+       [ -n "$GLITE_LB_EXPORT_JPPS" ] && jpps="--jpps $GLITE_LB_EXPORT_JPPS "
++      if [ -n "$GLITE_LB_EXPORT_JOBSDIR_KEEP" ]; then
++              keep_jobs="--store ${GLITE_LB_EXPORT_JOBSDIR_KEEP} "
++              [ -d $GLITE_LB_EXPORT_JOBSDIR_KEEP ] || mkdir -p $GLITE_LB_EXPORT_JOBSDIR_KEEP
++      fi
+       echo -n Starting glite-jp-importer ...
+       su - $GLITE_USER -c "$GLITE_LOCATION/bin/glite-jp-importer \
+-              -i $pidfile $jpreg_maildir $jpdump_maildir $jpps $creds" \
++              -i $pidfile $jpreg_maildir $jpdump_maildir $jpps $keep_jobs $creds" \
+       && echo " done" || echo " FAILED"
+ }
+Index: org.glite.jp.client/examples/glite-jp-importer.sh
+===================================================================
+RCS file: /cvs/jra1mw/org.glite.jp.client/examples/glite-jp-importer.sh,v
+retrieving revision 1.3
+diff -u -r1.3 glite-jp-importer.sh
+--- org.glite.jp.client/examples/glite-jp-importer.sh  16 Mar 2006 15:08:50 -0000      1.3
++++ org.glite.jp.client/examples/glite-jp-importer.sh  3 Apr 2006 18:59:49 -0000
+@@ -21,11 +21,9 @@
+   echo "Please specify the Job Provanance Primary Storage server."
+   exit 1
+ fi
+-# bookkeeping server
+-if [ -z "$GLITE_LB_EXPORT_BKSERVER" ]; then
+-  echo "Please specify the Book Keeping server."
+-  exit 1
+-fi
++# book keeping server
++GLITE_LB_SERVER_PORT=${GLITE_LB_SERVER_PORT:-9000}
++GLITE_LB_EXPORT_BKSERVER=${GLITE_LB_EXPORT_BKSERVER:-localhost:$GLITE_LB_SERVER_PORT}
+ # certificates
+ if [ -z "$X509_USER_CERT" -o -z "$X509_USER_KEY" ]; then
+   echo "Please set X509_USER_CERT and X509_USER_KEY."
+@@ -41,25 +39,30 @@
+   GLITE_LB_EXPORT_JPREG_MAILDIR=/tmp/jpreg
+   echo "GLITE_LB_EXPORT_JPREG_MAILDIR not specified (-J arguent of the bkserver), used $GLITE_LB_EXPORT_JPREG_MAILDIR"
+ fi
++# pidfile
++[ -n "$GLITE_JP_IMPORTER_PIDFILE" ] && pidfile="-i $GLITE_JP_IMPORTER_PIDFILE "
+ CERT_ARGS="-c $X509_USER_CERT -k $X509_USER_KEY"
+ GLITE_LB_EXPORT_JPDUMP_MAILDIR=${GLITE_LB_EXPORT_JPDUMP_MAILDIR:-/tmp/jpdump}
+-GLITE_LB_EXPORT_DUMPDIR_OLD=${GLITE_LB_EXPORT_DUMPDIR_OLD:-$GLITE_LB_EXPORT_DUMPDIR.old}
+-GLITE_LB_EXPORT_EXPORTDIR=${GLITE_LB_EXPORT_EXPORTDIR:-/tmp/lbexport}
++GLITE_LB_EXPORT_JOBSDIR=${GLITE_LB_EXPORT_JOBSDIR:-/tmp/lbexport}
+ PREFIX=${PREFIX:-`dirname $0`/..}
+ LOGDIR=$GLITE_LOCATION_VAR
+-GLITE_LB_EXPORT_PURGE_ARGS=${GLITE_LB_EXPORT_PURGE_ARGS:--a 1h -c 1h -n 1h -o 1d}
++GLITE_LB_EXPORT_PURGE_ARGS=${GLITE_LB_EXPORT_PURGE_ARGS:---aborted 1d --cleared 1d --cancelled 1d --other 7d}
+ [ -d $GLITE_LB_EXPORT_JPDUMP_MAILDIR ] || mkdir -p $GLITE_LB_EXPORT_JPDUMP_MAILDIR
+ [ -d $GLITE_LB_EXPORT_DUMPDIR ] || mkdir -p $GLITE_LB_EXPORT_DUMPDIR
+-[ -d $GLITE_LB_EXPORT_DUMPDIR_OLD ] || mkdir -p $GLITE_LB_EXPORT_DUMPDIR_OLD
+-[ -d $GLITE_LB_EXPORT_EXPORTDIR ] || mkdir -p $GLITE_LB_EXPORT_EXPORTDIR
++[ -n "$GLITE_LB_EXPORT_DUMPDIR_KEEP" -a ! -d $GLITE_LB_EXPORT_DUMPDIR_KEEP ] && mkdir -p $GLITE_LB_EXPORT_DUMPDIR_KEEP
++[ -d $GLITE_LB_EXPORT_JOBSDIR ] || mkdir -p $GLITE_LB_EXPORT_JOBSDIR
++if [ -n "$GLITE_LB_EXPORT_JOBSDIR_KEEP" ]; then
++  keep_jobs="--store ${GLITE_LB_EXPORT_JOBSDIR_KEEP} "
++  [ -d $GLITE_LB_EXPORT_JOBSDIR_KEEP ] || mkdir -p $GLITE_LB_EXPORT_JOBSDIR_KEEP
++fi
+ [ -d $LOGDIR ] || mkdir -p $LOGDIR
+ echo "Using cert args $CERT_ARGS"
+-$PREFIX/bin/glite-jp-importer -r $GLITE_LB_EXPORT_JPREG_MAILDIR -d $GLITE_LB_EXPORT_JPDUMP_MAILDIR $CERT_ARGS -g -p $GLITE_LB_EXPORT_JPPS > $LOGDIR/jp-importer.log 2>&1 &
++$PREFIX/bin/glite-jp-importer --reg-mdir $GLITE_LB_EXPORT_JPREG_MAILDIR --dump-mdir $GLITE_LB_EXPORT_JPDUMP_MAILDIR $CERT_ARGS -g --jpps $GLITE_LB_EXPORT_JPPS $pidfile$keep_jobs> $LOGDIR/jp-importer.log 2>&1 &
+ JP_PID=$!
+ trap "kill $JP_PID; exit 0" SIGINT
+@@ -68,8 +71,12 @@
+   for file in $GLITE_LB_EXPORT_DUMPDIR/*; do
+     if [ -s $file ]; then
+-      $PREFIX/sbin/glite-lb-lb_dump_exporter -d $file -s $GLITE_LB_EXPORT_EXPORTDIR -m $GLITE_LB_EXPORT_JPDUMP_MAILDIR
+-      mv $file $GLITE_LB_EXPORT_DUMPDIR_OLD
++      $PREFIX/sbin/glite-lb-lb_dump_exporter -d $file -s $GLITE_LB_EXPORT_JOBSDIR -m $GLITE_LB_EXPORT_JPDUMP_MAILDIR
++      if [ -n "$GLITE_LB_EXPORT_DUMPDIR_KEEP" ]; then
++        mv $file $GLITE_LB_EXPORT_DUMPDIR_KEEP
++      else
++        rm $file
++      fi
+     else
+       rm $file
+     fi
+Index: org.glite.jp.client/src/jpimporter.c
+===================================================================
+RCS file: /cvs/jra1mw/org.glite.jp.client/src/jpimporter.c,v
+retrieving revision 1.8
+diff -u -r1.8 jpimporter.c
+--- org.glite.jp.client/src/jpimporter.c       16 Jan 2006 17:20:26 -0000      1.8
++++ org.glite.jp.client/src/jpimporter.c       3 Apr 2006 18:59:49 -0000
+@@ -12,6 +12,7 @@
+ #include <errno.h>
+ #include <syslog.h>
+ #include <fcntl.h>
++#include <libgen.h>
+ #include "glite/lb/lb_maildir.h"
+ #include "glite/security/glite_gsplugin.h"
+@@ -66,6 +67,7 @@
+ static char                      *jpps = GLITE_JPPS;
+ static char                           reg_mdir[PATH_MAX] = GLITE_REG_IMPORTER_MDIR;
+ static char                           dump_mdir[PATH_MAX] = GLITE_DUMP_IMPORTER_MDIR;
++static char                           *store = NULL;
+ static struct soap       *soap;
+ static time_t                 cert_mtime;
+@@ -87,6 +89,7 @@
+       { "dump-mdir",   1, NULL,    'd'},
+       { "pidfile",     1, NULL,    'i'},
+       { "poll",        1, NULL,    't'},
++      { "store",       1, NULL,    's'},
+       { NULL,          0, NULL,     0}
+ };
+@@ -105,6 +108,7 @@
+               "\t-d, --dump-mdir    path to the 'LB maildir' subtree for LB dumps\n"
+               "\t-i, --pidfile      file to store master pid\n"
+               "\t-t, --poll         maildir polling interval (in seconds)\n",
++              "\t-s, --store        keep uploaded jobs in this directory\n",
+               me);
+ }
+@@ -157,6 +161,7 @@
+               case 'C': cadir = optarg; break;
+               case 'p': jpps = optarg; break;
+               case 't': poll = atoi(optarg); break;
++              case 's': store = optarg; break;
+               case 'r': strcpy(reg_mdir, optarg); break;
+               case 'd': strcpy(dump_mdir, optarg); break;
+               case 'i': strcpy(pidfile, optarg); break;
+@@ -187,6 +192,12 @@
+               
+       edg_wll_MaildirInit(reg_mdir);
+       edg_wll_MaildirInit(dump_mdir);
++      if (store && *store) {
++              if (mkdir(store, 0750) != 0 && errno != EEXIST) {
++                      fprintf(stderr, "Can't create directory %s: %s\n", store, strerror(errno));
++                      store = NULL;
++              }
++      }
+       if ( !debug ) {
+               if ( daemon(1,0) == -1 ) { perror("deamon()"); exit(1); }
+@@ -401,7 +412,9 @@
+       static int              readnew = 1;
+       char               *msg = NULL,
+                                  *fname = NULL,
+-                                 *aux;
++                                 *aux,
++                                 *bname;
++      char                        fspec[PATH_MAX];
+       int                             ret;
+       int                             fhnd;
+       msg_pattern_t   tab[] = {
+@@ -469,6 +482,20 @@
+               ret = soap_call___jpsrv__CommitUpload(soap, tab[_jpps].val?:jpps, "", &cu_in, &empty);
+               if ( (ret = check_soap_fault(soap, ret)) ) break;
+               dprintf(("[%s] Dump upload succesfull\n", name));
++              if (store && *store) {
++                      bname = strdup(tab[_file].val);
++                      snprintf(fspec, sizeof fspec, "%s/%s", store, basename(bname));
++                      free(bname);
++                      if (rename(tab[_file].val, fspec) != 0) 
++                              fprintf(stderr, "moving %s to %s failed: %s\n", tab[_file].val, fspec, strerror(errno));
++                      else
++                              dprintf(("[%s] moving %s to %s OK\n", name, tab[_file].val, fspec));
++              } else {
++                      if (unlink(tab[_file].val) != 0)
++                              fprintf(stderr, "removing %s failed: %s\n", tab[_file].val, strerror(errno));
++                      else
++                              dprintf(("[%s] %s removed\n", name, tab[_file].val));
++              }
+       } while (0);
+       edg_wll_MaildirTransEnd(dump_mdir, fname, ret? LBMD_TRANS_FAILED_RETRY: LBMD_TRANS_OK);
+Index: org.glite.lb.server/config/startup
+===================================================================
+RCS file: /cvs/jra1mw/org.glite.lb.server/config/startup,v
+retrieving revision 1.13
+diff -u -r1.13 startup
+--- org.glite.lb.server/config/startup 15 Mar 2006 18:12:21 -0000      1.13
++++ org.glite.lb.server/config/startup 3 Apr 2006 18:59:49 -0000
+@@ -44,7 +44,7 @@
+       [ -z "$creds" ] && echo $0: WARNING: No credentials specified. Using default lookup which is dangerous. >&2
+-      [ -n "$GLITE_LB_SERVER_PORT" ] && port="-p $GLITE_LB_SERVER_PORT"
++      [ -n "$GLITE_LB_SERVER_PORT" ] && port="-p $GLITE_LB_SERVER_PORT -w $((GLITE_LB_SERVER_PORT+3))"
+       echo -n Starting glite-lb-bkserver ...
+       su - $GLITE_USER -c "$GLITE_LOCATION/bin/glite-lb-bkserverd \
+Index: org.glite.lb.client/Makefile
+===================================================================
+RCS file: /cvs/jra1mw/org.glite.lb.client/Makefile,v
+retrieving revision 1.55
+diff -u -r1.55 Makefile
+--- org.glite.lb.client/Makefile       23 Mar 2006 16:38:44 -0000      1.55
++++ org.glite.lb.client/Makefile       3 Apr 2006 19:04:06 -0000
+@@ -292,7 +292,7 @@
+       for p in ${EXAMPLES} ${EXAMPLES_CL} ${sh_PROGS} ; do \
+               ${INSTALL} -m 755 "$$p" "${PREFIX}/examples/glite-lb-$$p"; \
+       done
+-      ${INSTALL} -m 755 ${top_srcdir}/examples/export.sh "${PREFIX}/examples/glite-lb-export.sh"
++      ${INSTALL} -m 755 ${top_srcdir}/src/export.sh "${PREFIX}/sbin/glite-lb-export.sh"
+       ${INSTALL} -m 644 ${MAN_GZ} ${PREFIX}/share/man/man1
+ clean:
+Index: org.glite.lb.client/examples/export.sh
+===================================================================
+RCS file: org.glite.lb.client/examples/export.sh
+diff -N org.glite.lb.client/examples/export.sh
+--- org.glite.lb.client/examples/export.sh     30 Mar 2006 15:23:51 -0000      1.3
++++ /dev/null  1 Jan 1970 00:00:00 -0000
+@@ -1,58 +0,0 @@
+-#! /bin/bash
+-
+-#
+-# script for exporing jobs from bkserver which should be periodically run
+-# together with running jp-importer
+-#
+-# it uses configuration from enviroment ==> may require a configuration wrapper
+-#
+-
+-#autodetect the prefix
+-PREFIX=${GLITE_LOCATION:-`dirname $0`/..}
+-
+-if [ -n "$GLITE_HOST_CERT" -a -n "$GLITE_HOST_KEY" ] ;then
+-      creds="-c '$GLITE_HOST_CERT' -k '$GLITE_HOST_KEY'"
+-      X509_USER_CERT="$GLITE_HOST_CERT"
+-      X509_USER_KEY="$GLITE_HOST_KEY"
+-fi
+-if test -z "$creds"; then
+-      if su - $GLITE_USER -c "test -r /etc/grid-security/hostkey.pem -a -r /etc/grid-security/hostcert.pem"; then
+-              echo "$0: WARNING: /etc/grid-security/hostkey.pem readable by $GLITE_USER"
+-              creds="-c /etc/grid-security/hostcert.pem -k /etc/grid-security/hostkey.pem"
+-              X509_USER_CERT=/etc/grid-security/hostcert.pem
+-              X509_USER_KEY=/etc/grid-security/hostkey.pem
+-      fi
+-fi
+-
+-
+-[ -z "$creds" ] && echo $0: WARNING: No credentials specified. Using default lookup which is dangerous. >&2
+-
+-
+-
+-# dump directory of bkserver
+-GLITE_LB_EXPORT_DUMPDIR=${GLITE_LB_EXPORT_DUMPDIR:-/tmp/dump}
+-GLITE_LB_EXPORT_DUMPDIR_OLD=${GLITE_LB_EXPORT_DUMPDIR_OLD:-$GLITE_LB_EXPORT_DUMPDIR.old}
+-# maildir dump directory for jp importer
+-GLITE_LB_EXPORT_JPDUMP_MAILDIR=${GLITE_LB_EXPORT_JPDUMP_MAILDIR:-/tmp/jpdump}
+-# directory with exported data (file per job)
+-GLITE_LB_EXPORT_EXPORTDIR=${GLITE_LB_EXPORT_EXPORTDIR:-/tmp/lbexport}
+-# purge args (timeouts)
+-GLITE_LB_EXPORT_PURGE_ARGS=${GLITE_LB_EXPORT_PURGE_ARGS:--a 1h -c 1h -n 1h -o 1d}
+-# Book Keeping Server
+-GLITE_LB_EXPORT_BKSERVER=${GLITE_LB_EXPORT_BKSERVER:-localhost:9000}
+-
+-[ -d $GLITE_LB_EXPORT_JPDUMP_MAILDIR ] || mkdir -p $GLITE_LB_EXPORT_JPDUMP_MAILDIR
+-[ -d $GLITE_LB_EXPORT_DUMPDIR ] || mkdir -p $GLITE_LB_EXPORT_DUMPDIR
+-[ -d $GLITE_LB_EXPORT_DUMPDIR_OLD ] || mkdir -p $GLITE_LB_EXPORT_DUMPDIR_OLD
+-[ -d $GLITE_LB_EXPORT_EXPORTDIR ] || mkdir -p $GLITE_LB_EXPORT_EXPORTDIR
+-
+-X509_USER_CERT="$X509_USER_CERT" X509_USER_KEY="$X509_USER_KEY" $PREFIX/sbin/glite-lb-purge $GLITE_LB_EXPORT_PURGE_ARGS -l -m $GLITE_LB_EXPORT_BKSERVER
+-
+-for file in $GLITE_LB_EXPORT_DUMPDIR/*; do
+-  if [ -s $file ]; then
+-    $PREFIX/sbin/glite-lb-lb_dump_exporter -d $file -s $GLITE_LB_EXPORT_EXPORTDIR -m $GLITE_LB_EXPORT_JPDUMP_MAILDIR
+-    mv $file $GLITE_LB_EXPORT_DUMPDIR_OLD
+-  else
+-    rm $file
+-  fi
+-done
+Index: org.glite.lb.client/src/export.sh
+===================================================================
+RCS file: org.glite.lb.client/src/export.sh
+diff -N org.glite.lb.client/src/export.sh
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ org.glite.lb.client/src/export.sh  3 Apr 2006 19:04:06 -0000
+@@ -0,0 +1,63 @@
++#! /bin/bash
++
++#
++# script for exporing jobs from bkserver which should be periodically run
++# together with running jp-importer
++#
++# it uses configuration from enviroment ==> may require a configuration wrapper
++#
++
++#autodetect the prefix
++PREFIX=${GLITE_LOCATION:-`dirname $0`/..}
++
++if [ -n "$GLITE_HOST_CERT" -a -n "$GLITE_HOST_KEY" ] ;then
++      creds="-c '$GLITE_HOST_CERT' -k '$GLITE_HOST_KEY'"
++      X509_USER_CERT="$GLITE_HOST_CERT"
++      X509_USER_KEY="$GLITE_HOST_KEY"
++fi
++if test -z "$creds"; then
++      if su - $GLITE_USER -c "test -r /etc/grid-security/hostkey.pem -a -r /etc/grid-security/hostcert.pem"; then
++              echo "$0: WARNING: /etc/grid-security/hostkey.pem readable by $GLITE_USER"
++              creds="-c /etc/grid-security/hostcert.pem -k /etc/grid-security/hostkey.pem"
++              X509_USER_CERT=/etc/grid-security/hostcert.pem
++              X509_USER_KEY=/etc/grid-security/hostkey.pem
++      fi
++fi
++
++
++[ -z "$creds" ] && echo $0: WARNING: No credentials specified. Using default lookup which is dangerous. >&2
++
++
++
++# dump directory of bkserver
++GLITE_LB_EXPORT_DUMPDIR=${GLITE_LB_EXPORT_DUMPDIR:-/tmp/dump}
++GLITE_LB_EXPORT_DUMPDIR_KEEP=${GLITE_LB_EXPORT_DUMPDIR_KEEP:-""}
++# maildir dump directory for jp importer
++GLITE_LB_EXPORT_JPDUMP_MAILDIR=${GLITE_LB_EXPORT_JPDUMP_MAILDIR:-/tmp/jpdump}
++# directory with exported data (file per job)
++GLITE_LB_EXPORT_JOBSDIR=${GLITE_LB_EXPORT_JOBSDIR:-/tmp/lbexport}
++# purge args (timeouts)
++GLITE_LB_EXPORT_PURGE_ARGS=${GLITE_LB_EXPORT_PURGE_ARGS:--a 1h -c 1h -n 1h -o 1d}
++# Book Keeping Server
++GLITE_LB_SERVER_PORT=${GLITE_LB_SERVER_PORT:-9000}
++GLITE_LB_EXPORT_BKSERVER=${GLITE_LB_EXPORT_BKSERVER:-localhost:$GLITE_LB_SERVER_PORT}
++
++[ -d $GLITE_LB_EXPORT_JPDUMP_MAILDIR ] || mkdir -p $GLITE_LB_EXPORT_JPDUMP_MAILDIR
++[ -d $GLITE_LB_EXPORT_DUMPDIR ] || mkdir -p $GLITE_LB_EXPORT_DUMPDIR
++[ -d $GLITE_LB_EXPORT_DUMPDIR_KEEP ] || mkdir -p $GLITE_LB_EXPORT_DUMPDIR_KEEP
++[ -d $GLITE_LB_EXPORT_JOBSDIR ] || mkdir -p $GLITE_LB_EXPORT_JOBSDIR
++
++X509_USER_CERT="$X509_USER_CERT" X509_USER_KEY="$X509_USER_KEY" $PREFIX/sbin/glite-lb-purge $GLITE_LB_EXPORT_PURGE_ARGS -l -m $GLITE_LB_EXPORT_BKSERVER
++
++for file in $GLITE_LB_EXPORT_DUMPDIR/*; do
++  if [ -s $file ]; then
++    $PREFIX/sbin/glite-lb-lb_dump_exporter -d $file -s $GLITE_LB_EXPORT_JOBSDIR -m $GLITE_LB_EXPORT_JPDUMP_MAILDIR
++    if [ -n "$GLITE_LB_EXPORT_DUMPDIR_KEEP" ]; then
++      mv $file $GLITE_LB_EXPORT_DUMPDIR_KEEP
++    else
++      rm $file
++    fi
++  else
++    rm $file
++  fi
++done