Issue #1835 - additional ldm updates

- re-arranged ldm directory structure
- added additional auto-configuration to ldm
- Amend: remove ldadmin-pl.conf

Change-Id: I309f84d31ce7ea59e0e752bc138928ac1b9c9244

Former-commit-id: 8015724ee64c8ca28498888cc91b5ddc14d15f01
This commit is contained in:
Bryan Kowal 2013-04-25 13:54:55 -05:00
parent 0da0ddf1d8
commit 9f2e1d99a8
3 changed files with 79 additions and 258 deletions

View file

@ -45,16 +45,11 @@ if [ $? -ne 0 ]; then
fi
# create the ldm directory
/bin/mkdir -p %{_build_root}/usr/local/ldm-%{_ldm_version}/SOURCES
/bin/mkdir -p %{_build_root}/usr/local/ldm/SOURCES
if [ $? -ne 0 ]; then
exit 1
fi
# create profile directory and ld directory
/bin/mkdir -p %{_build_root}/etc/ld.so.conf.d
if [ $? -ne 0 ]; then
exit 1
fi
/bin/mkdir -p %{_build_root}/etc/profile.d
if [ $? -ne 0 ]; then
exit 1
@ -63,7 +58,7 @@ fi
%build
%install
_ldm_destination=%{_build_root}/usr/local/ldm-%{_ldm_version}
_ldm_destination=%{_build_root}/usr/local/ldm
_ldm_destination_source=${_ldm_destination}/SOURCES
_NATIVELIB_PROJECTS=( 'edexBridge' 'decrypt_file' )
@ -122,20 +117,6 @@ done
if [ $? -ne 0 ]; then
exit 1
fi
/bin/touch %{_build_root}/etc/ld.so.conf.d/awips2-ldm-noarch.conf
if [ $? -ne 0 ]; then
exit 1
fi
echo "/usr/local/ldm-%{_ldm_version}/lib" > \
%{_build_root}/etc/ld.so.conf.d/awips2-ldm-noarch.conf
if [ $? -ne 0 ]; then
exit 1
fi
echo "/awips2/qpid/lib" >> \
%{_build_root}/etc/ld.so.conf.d/awips2-ldm-noarch.conf
if [ $? -ne 0 ]; then
exit 1
fi
%pre
if [ -d /tmp/ldm ]; then
@ -144,14 +125,16 @@ fi
mkdir -p /tmp/ldm
for dir in etc .ssh;
do
if [ -d /usr/local/ldm-%{_ldm_version}/${dir} ]; then
scp -qrp /usr/local/ldm-%{_ldm_version}/${dir} /tmp/ldm
if [ -d /usr/local/ldm/${dir} ]; then
scp -qrp /usr/local/${dir} /tmp/ldm
fi
done
%post
_ldm_dir=/usr/local/ldm-%{_ldm_version}
_ldm_dir=/usr/local/ldm
_ldm_root_dir=${_ldm_dir}/ldm-%{_ldm_version}
_myHost=`hostname`
_myHost=`echo ${_myHost} | cut -f1 -d'-'`
pushd . > /dev/null 2>&1
cd ${_ldm_dir}/SOURCES
@ -184,42 +167,14 @@ if [ $? -ne 0 ]; then
fi
popd > /dev/null 2>&1
# create the ldm directory link
pushd . > /dev/null 2>&1
cd /usr/local
if [ -h /usr/local/ldm ]; then
# if this command fails, ldm may be a directory
# instead of a link.
rm -f /usr/local/ldm
if [ $? -ne 0 ]; then
echo "FATAL: failed to remove the /usr/local/ldm link!"
exit 1
fi
else
if [ -d /usr/local/ldm ]; then
# archive the directory
_identifier=`date +"%s"`
mv /usr/local/ldm /usr/local/ldm.archive_${_identifier}
if [ $? -ne 0 ]; then
echo "FATAL: failed to archive the /usr/local/ldm directory!"
exit 1
fi
echo "INFO: archived /usr/local/ldm to /usr/local/ldm.archive_${_identifier}."
fi
fi
ln -s ${_ldm_dir} ldm
if [ $? -ne 0 ]; then
echo "FATAL: failed to create the /usr/local/ldm link."
exit 1
fi
# create .bash_profile
echo 'export PATH=$HOME/decoders:$HOME/util:$HOME/bin:$PATH' > \
/usr/local/ldm/.bash_profile
echo 'export MANPATH=$HOME/share/man:/usr/share/man' >> \
/usr/local/ldm/.bash_profile
popd > /dev/null 2>&1
if [ ! -f /usr/local/ldm/.bash_profile ]; then
echo 'export PATH=$HOME/decoders:$HOME/util:$HOME/bin:$PATH' > \
/usr/local/ldm/.bash_profile
echo 'export MANPATH=$HOME/share/man:/usr/share/man' >> \
/usr/local/ldm/.bash_profile
/bin/chown ldm:fxalpha /usr/local/ldm/.bash_profile
fi
# construct pqact
pushd . > /dev/null 2>&1
@ -240,10 +195,13 @@ cp pqact.conf.template pqact.conf
if [ $? -ne 0 ]; then
exit 1
fi
cat pqact.conf.dev >> pqact.conf
if [ $? -ne 0 ]; then
echo "ERROR: Unable to merge pqact.conf.dev and pqact.conf."
exit 1
if [ ${_myHost} != "cpsbn1" -a ${_myHost} != "cpsbn2" -a ${_myHost} != "dx1" -a ${_myHost} != "dx2" ] ; then
cat pqact.conf.dev >> pqact.conf
if [ $? -ne 0 ]; then
echo "ERROR: Unable to merge pqact.conf.dev and pqact.conf."
exit 1
fi
fi
popd > /dev/null 2>&1
@ -254,7 +212,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
export _current_dir=`pwd`
su ldm -lc "cd ${_current_dir}; ./configure --disable-max-size --with-noaaport --disable-root-actions" \
su ldm -lc "cd ${_current_dir}; ./configure --disable-max-size --with-noaaport --disable-root-actions --prefix=${_ldm_dir}" \
> configure.log 2>&1
if [ $? -ne 0 ]; then
echo "FATAL: ldm configure has failed!"
@ -353,50 +311,72 @@ cd ..
popd > /dev/null 2>&1
for dir in etc .ssh;
if [ ! -d .ssh ] &&
[ -d /tmp/ldm/.ssh ]; then
scp -qrp /tmp/ldm/.ssh /usr/local/ldm
fi
for _file in $( ls /tmp/ldm/etc/pqact.conf.* | grep -wE "pqact.conf.[a-z]{3,4}" | grep -v pqact.conf.dev | xargs ) ;
do
if [ -d /tmp/ldm/${dir} ]; then
scp -qrp /tmp/ldm/${dir} /usr/local/ldm-%{_ldm_version}
if [[ ! -f /usr/local/ldm/etc/${_file} ]]; then
scp -qp /tmp/ldm/etc/${_file} /usr/local/ldm/etc/
fi
done
#if a remote CP site, copy over the filtered data configuration
case $SITE_IDENTIFIER in gum|hfo|pbp|vrh)
echo -e "\nInstalling ldmd.conf for $SITE_IDENTIFIER."
if ! scp /usr/local/ldm-%{_ldm_version}/etc/ldmd.conf.$SITE_IDENTIFIER cpsbn1:/usr/local/ldm/etc/ldmd.conf
then
echo "ERROR: Failed copy of ldmd.conf to cpsbn1"
fi
if [ ${_myHost} == "dx1" -o ${_myHost} == "dx2" ] ; then
case $SITE_IDENTIFIER in gum|hfo|pbp|vrh)
echo -e "\nInstalling ldmd.conf for $SITE_IDENTIFIER."
if ! scp /usr/local/ldm-%{_ldm_version}/etc/ldmd.conf.$SITE_IDENTIFIER cpsbn1:/usr/local/ldm/etc/ldmd.conf
then
echo "ERROR: Failed copy of ldmd.conf to cpsbn1"
fi
if ! scp /usr/local/ldm-%{_ldm_version}/etc/ldmd.conf.$SITE_IDENTIFIER cpsbn2:/usr/local/ldm/etc/ldmd.conf
then
echo "ERROR: Failed copy of ldmd.conf to cpsbn2"
fi
;;
esac
if ! scp /usr/local/ldm-%{_ldm_version}/etc/ldmd.conf.$SITE_IDENTIFIER cpsbn2:/usr/local/ldm/etc/ldmd.conf
then
echo "ERROR: Failed copy of ldmd.conf to cpsbn2"
fi
;;
esac
fi
# remove the extra configuration files
rm -f /usr/local/ldm-%{_ldm_version}/etc/ldmd.conf.*
rm -f /usr/local/ldm/etc/ldmd.conf.*
/sbin/ldconfig
# create route-eth1, if it does not already exist.
if [ ! -f /etc/sysconfig/network-scripts/route-eth1 ]; then
_route_eth1=/etc/sysconfig/network-scripts/route-eth1
if [ ${_myHost} == "cpsbn1" -o ${_myHost} == "cpsbn2" ] ; then
if [ ! -f /etc/sysconfig/network-scripts/route-eth1 ]; then
_route_eth1=/etc/sysconfig/network-scripts/route-eth1
touch ${_route_eth1}
echo "ADDRESS0=224.0.1.1" > ${_route_eth1}
echo "NETMASK0=255.255.255.255" >> ${_route_eth1}
echo "ADDRESS1=224.0.1.2" >> ${_route_eth1}
echo "NETMASK1=255.255.255.255" >> ${_route_eth1}
echo "ADDRESS2=224.0.1.3" >> ${_route_eth1}
echo "NETMASK2=255.255.255.255" >> ${_route_eth1}
echo "ADDRESS3=224.0.1.4" >> ${_route_eth1}
echo "NETMASK3=255.255.255.255" >> ${_route_eth1}
echo "ADDRESS4=224.0.1.5" >> ${_route_eth1}
echo "NETMASK4=255.255.255.255" >> ${_route_eth1}
touch ${_route_eth1}
echo "ADDRESS0=224.0.1.1" > ${_route_eth1}
echo "NETMASK0=255.255.255.255" >> ${_route_eth1}
echo "ADDRESS1=224.0.1.2" >> ${_route_eth1}
echo "NETMASK1=255.255.255.255" >> ${_route_eth1}
echo "ADDRESS2=224.0.1.3" >> ${_route_eth1}
echo "NETMASK2=255.255.255.255" >> ${_route_eth1}
echo "ADDRESS3=224.0.1.4" >> ${_route_eth1}
echo "NETMASK3=255.255.255.255" >> ${_route_eth1}
echo "ADDRESS4=224.0.1.5" >> ${_route_eth1}
echo "NETMASK4=255.255.255.255" >> ${_route_eth1}
# restart networking
/sbin/service network restart
# restart networking
/sbin/service network restart
fi
# check for some AWIPS specific links for the CP devices
for _dirs in data logs ; do
if [[ -h /usr/local/ldm/${_dirs} && $(readlink /usr/local/ldm/${_dirs}) != "/data/ldm/${_dirs}" ]] ; then
if ! rm -f /usr/local/ldm/${_dirs} ; then
echo "ERROR: Failed to remove /usr/local/ldm/${_dirs}"
else
if ! ln -s /data/ldm/${_dirs} /usr/local/ldm/${_dirs} ; then
echo "ERROR: Failed to create link from /usr/local/ldm/${_dirs} --> /data/ldm/${_dirs}"
fi
fi
fi
done
fi
rm -rf /tmp/ldm
@ -416,9 +396,8 @@ rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-,ldm,fxalpha,-)
%dir /usr/local/ldm-%{_ldm_version}
%dir /usr/local/ldm-%{_ldm_version}/SOURCES
/usr/local/ldm-%{_ldm_version}/SOURCES/*
%dir /usr/local/ldm
%dir /usr/local/ldm/SOURCES
/usr/local/ldm/SOURCES/*
%attr(644,root,root) /etc/ld.so.conf.d/awips2-ldm-noarch.conf
%attr(755,root,root) /etc/profile.d/awipsLDM.csh

View file

@ -1,158 +0,0 @@
# The fully-qualified hostname of the computer system. If the name isn't
# fully-qualified (i.e., if it doesn't include the domain) then replace
# "dev27.oma.us.ray.com" with the fully-qualified hostname.
chomp($hostname = `hostname --fqdn`);
# The LDM home directory:
$ldmhome = "/usr/local/ldm-6.11.2";
# Requested size, in bytes, of the data portion of the LDM product-queue. The
# actual size might be slightly greater than the requested size for performance
# reasons. It is recommended that IDD sites keep at least one hour's worth of
# data in the queue. This means that the queue size should depend upon how
# much data is requested. After the queue has stabilized, use the pqmon(1)
# utility to monitor the age of the oldest product in the queue and adjust this
# value, if necessary. Understood suffixes include "K", "M", and "G" for
# "kilo", "mega", and "giga", respectively. The default requested size
# is 500 megabytes (i.e., "500M").
$pq_size = "500M";
# Number of slots in the LDM product-queue. This is the maximum number
# of data-products that the product-queue can contain. Because it is
# recommended that IDD sites keep at least one hour's worth of data in
# the queue, this value should equal the maximum expected number of
# data-products per hour. If the value is "default", then the number
# of slots will be computed using the size of the product-queue and a
# mean data-product size of 4096 bytes. Use the pqmon(1) utility to
# monitor the number of data-products in the product-queue and adjust
# this value, if necessary.
$pq_slots = "default";
# Size of the pqsurf(1) product-queue in bytes. Do not use any suffixes. This
# is only meaningful if your LDM configuration-file executes the pqsurf(1)
# utility. You probably won't need to change this.
$surf_size = "2000000";
# Default number of log files that the "newlog" command should keep around:
$numlogs = 7;
# File paths - everything here is based on the $ldmhome variable by default:
$bin_path = "$ldmhome/bin";
$etc_path = "$ldmhome/etc";
$log_path = "$ldmhome/logs";
$data_path = "$ldmhome/data";
$pq_path = "$data_path/ldm.pq";;
# NOTE: If you change the following, then you must also modify the EXEC entry
# for the "pqsurf(1)" utility in the LDM configuration-file (etc/ldmd.conf)
# to ensure that the same pathname is used (via the "-q path" option).
$surf_path = "$data_path/pqsurf.pq";
# ldmadmin(1) file locations and names:
$pid_file = "$ldmhome/ldmd.pid";
$lock_file = "$ldmhome/.ldmadmin.lck";
$log_file = "$log_path/ldmd.log";
$ldmd_conf = "$etc_path/ldmd.conf";
$pqact_conf = "$etc_path/pqact.conf";
$scour_file = "$etc_path/scour.conf";
# Whether or not to rotate the LDM log files whenever the LDM is started or
# restarted. They are rotated if and only if the value is non-zero.
$log_rotate = 0;
# The IP address of the network interface to be used by the LDM server.
# Address "0.0.0.0" means that the LDM server will use all available network
# interfaces.
chomp($cmd = q{/sbin/ifconfig bond0 | grep 'inet\ addr' | awk '{print $2}' | sed 's/addr://'});
chomp($ip_addr = `$cmd`);
# The port on which the LDM server will listen for connections:
$port = 388;
################################################################################
# The following variables are new with LDM version 6.8.0:
################################################################################
# Maximum latency in seconds. A data-product arriving with a latency greater
# than this will be rejected by any downstream LDM process.
$max_latency = 3600;
# Request time-offset in seconds. Nomally, a downstream LDM will request data
# starting with just after the last successfully received data-product. If that
# product doesn't exist in the upstream LDM's product-queue, however, then the
# downstream LDM will request data starting from this many seconds ago. The
# need for this parameter can arise if, for example, the downstream LDM has been
# offline long enough for the last successfully recieved data-product to be
# purged from the upstream LDM's product-queue. The value must be less than or
# equal to $max_latency.
$offset = 3600;
# Whether or not to delete the product-information files when the product-queue
# is deleted (via the "delqueue" command). If true, then the new
# product-queue will be initially populated by requests for data that go back
# $offset seconds in time; otherwise, the requests for data that are the same
# as before will start with the last successfully-received data-product for
# each connection. Relay nodes should probably set this variable to true in
# order to regenerate a buffer of data while leaf nodes should probably set it
# to false in order to avoid receiving (and processing) duplicate data-products.
$delete_info_files = 0;
# The maximum number of extant client connections the LDM server will allow
# before additional incoming connections requests are rejected.
$max_clients = 256;
################################################################################
# The following deal with verifying the accuracy of the system clock.
# Whether or not to check the system clock at all:
$check_time = 0;
# Whether or not to print a warning if time-checking is disabled:
$warn_if_check_time_disabled = 0;
# Pathname of the ntpdate(1) utility:
$ntpdate = "/usr/sbin/ntpdate";
# Timeout, in seconds, for the ntpdate(1) utility:
$ntpdate_timeout = 5;
# Time server hostnames. Modify to suit your needs. They're accessed in
# random order.
@time_servers = (
"ntp.ucsd.edu",
"ntp1.cs.wisc.edu",
"ntppub.tamu.edu",
"otc1.psu.edu",
"timeserver.unidata.ucar.edu",
);
# Maximum allowable time-difference in seconds:
$check_time_limit = 10;
# Whether or not to abort on failure:
$abort_if_check_time_failure = 0;
################################################################################
# The following deal with LDM performance metrics.
# The netstat(1) command for printing numeric port numbers of TCP Internet
# connections:
$netstat = "/bin/netstat -A inet -t -n";
# The metrics file into which the "addmetrics" command appends data:
$metrics_file = "$log_path/metrics.txt";
# The file-pattern for the metrics files to be plotted by the "plotmetrics"
# command:
$metrics_files = "/usr/local/ldm-6.11.2/logs/metrics.txt*";
# The number of metrics-files that the "newmetrics" command should keep
# around:
$num_metrics = 4;
################################################################################
# The following is necessary because the last executable statement of a
# "require"ed file must have a non-zero value.
################################################################################
1;