171
171
echo "Fallback /etc/nordugrid.conf was found, trying to use that one"
172
172
ARC_CONFIG="/etc/nordugrid.conf"
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"
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"
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"
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
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
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 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}"
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"