~ubuntu-branches/debian/sid/nordugrid-arc/sid

« back to all changes in this revision

Viewing changes to src/services/ldap-infosys/grid-infosys.in

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2012-12-13 16:41:31 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20121213164131-0fumka0jar8mxm07
Tags: 2.0.1-1
* 2.0.1 Release
* Drop patches accepted upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
        echo "Fallback /etc/nordugrid.conf was found, trying to use that one"
172
172
        ARC_CONFIG="/etc/nordugrid.conf"
173
173
    else
174
 
        log_warning_msg "arc.conf was not found. If this file is in a non-standard place,"
175
 
        log_warning_msg "  it can be set with the ARC_CONFIG environment variable"
176
 
        exit 0
 
174
        log_failure_msg "arc.conf was not found. If this file is in a non-standard place,"
 
175
        log_failure_msg "  it can be set with the ARC_CONFIG environment variable"
 
176
        exit 1
177
177
    fi
178
178
fi
179
179
 
757
757
        print "\n";
758
758
 
759
759
        print "dn: Mds-Vo-name=resource,o=Grid\n";
760
 
        print "objectClass: Mds\n";
761
760
        print "objectClass: MdsVo\n";
762
761
        print "Mds-Vo-name: resource\n";
763
762
        print "Mds-validfrom: " . strftime("%Y%m%d%H%M%SZ\n", gmtime());
1161
1160
        url=${CONFIG_url}
1162
1161
        echo "$unique_id $url" > "$site_config"
1163
1162
      # LOOP END 
1164
 
      # Create script
1165
 
      printf "#!/bin/sh\n/$ARC_LOCATION/@pkgdatasubdir@/glite-info-provider-ldap -m \"$site_bdii\" -c $site_config\n" > $site_provider
 
1163
      # Create script and make glite provider use arc directories
 
1164
      printf "#!/bin/sh\nexport GLITE_LOCATION_VAR=${bdii_tmp_dir}\n/$ARC_LOCATION/@pkgdatasubdir@/glite-info-provider-ldap -m \"$site_bdii\" -c $site_config\n" > $site_provider
1166
1165
      chmod +x $site_provider
1167
1166
    done
1168
1167
 
1263
1262
    bdii_cachesize_line=`egrep '^[[:space:]]*'set_cachesize ${bdii_db_config}`
1264
1263
    if [ -n "${bdii_cachesize_line}" ]; then
1265
1264
        if [ -e /proc/meminfo ]; then
1266
 
          memsize=$(grep MemTotal /proc/meminfo | awk '{print $2}')000
 
1265
          memsize=$(grep MemFree /proc/meminfo | awk '{print $2}')000
1267
1266
          bdii_default_set_cachesize_kb=$memsize;
1268
1267
          bdii_default_set_cachesize_gb=`echo ${bdii_cachesize_line} | awk '{print $2}'`
1269
1268
          bdii_default_set_cachesize_kb=`echo ${bdii_cachesize_line} | awk '{print $3}'`
1270
1269
          if [ $bdii_default_set_cachesize_gb != '0' ]; then
1271
1270
              bdii_default_set_cachesize_gb=${bdii_default_set_cachesize_gb}000000000
1272
 
              let sum=${bdii_default_set_cachesize_gb}+${bdii_default_set_cachesize_kb}
1273
 
              bdii_default_set_cachesize_kb=$sum
 
1271
              let bdii_cachesize_mem_sum=${bdii_default_set_cachesize_gb}+${bdii_default_set_cachesize_kb}
 
1272
              bdii_default_set_cachesize_kb=$bdii_cachesize_mem_sum
1274
1273
          fi
1275
 
          if [ $bdii_default_set_cachesize_kb -ge $memsize ]; then
 
1274
          let half_memsize=${memsize}/2
 
1275
          if [ $bdii_default_set_cachesize_kb -ge $half_memsize ]; then
1276
1276
             log_warning_msg "The system does not fulfill BDII optimal memory requirements. ARC will try to fix it anyway..."
1277
 
             let a=$memsize/16
1278
 
             cachesize=$a
 
1277
             let bdii_cachesize_new_value=$memsize/16
 
1278
             new_bdii_cachesize=$bdii_cachesize_new_value
1279
1279
             TEMPBDIIDBCONFIG=`mktemp -q /tmp/DB_CONFIG.XXXXXX`
 
1280
             chmod 644 $TEMPBDIIDBCONFIG
1280
1281
             if [ $? -ne 0 ]; then
1281
1282
               log_warning_msg "Can't create workaround DB_CONFIG temp file. If slapd doesn't start,"
1282
1283
               log_warning_msg "please manually set set_cachesize parameter in ${bdii_db_config}"
1283
1284
             else 
1284
 
               sed "s/^set_cachesize.*$/set_cachesize 0 $cachesize 1/" $bdii_db_config > $TEMPBDIIDBCONFIG
 
1285
               sed "s/^set_cachesize.*$/set_cachesize 0 $new_bdii_cachesize 1/" $bdii_db_config > $TEMPBDIIDBCONFIG
1285
1286
               bdii_db_config=${TEMPBDIIDBCONFIG}
1286
 
               log_warning_msg "DB_CONFIG set_cachesize is now :  0 $cachesize 1"
 
1287
               log_warning_msg "DB_CONFIG set_cachesize is now :  0 $new_bdii_cachesize 1"
1287
1288
             fi
1288
1289
          fi
1289
1290
        else