If you already have a previous version of the LDM installed and working, then you can probably skip these steps.
Edit the pqact configuration-file, etc/pqact.conf, if appropriate
Edit the scour configuration-file, etc/scour.conf, if appropriate
First, find out who your upstream feed site(s) will be. If you don't know and you are qualified to participate in the Unidata IDD, then contact the Unidata Program Center at <idd-connect@unidata.ucar.edu> with the following information:
Ask the administrator of the upstream LDM to add ALLOW entries for your LDM to the upstream LDM's configuration-file, ldmd.conf. For example,
ALLOW UNIDATA your.ldm.host ALLOW NLDN your.ldm.host
Workshop-specific instructions.
This file tells an LDM what to do on startup. Possibilities include executing programs, requesting data, and authorizing connections. The default file that comes with the distribution contains examples. More information on this configuration-file can be found on the ldmd.conf webpage.
Entries that you should or might have in this file -- depending on your exact situation -- are:
REQUEST entries for your primary upstream LDMs. For example
REQUEST UNIDATA ".*" host1.site1.edu PRIMARY
REQUEST NLDN ".*" host2.site2.edu PRIMARY
For a given feedtype and data-product identifier ERE, you may have more than one such PRIMARY request. Read, however, the discussion on tradeoffs in configuring the LDM.
Alternate (i.e., secondary) sources for certain data-feeds, if appropriate. For example
REQUEST UNIDATA ".*" host3.site3.edu ALTERNATE
REQUEST NLDN ".*" host4.site4.edu ALTERNATE
For a given feedtype and data-product identifier ERE, you may have more than one such ALTERNATE request. Read, however, the discussion on the tradeoffs in configuring the LDM.
Because the ALTERNATE keyword is an alias for a maximum HEREIS size of zero, data-products will be delivered more slowly than if the PRIMARY keyword had been used. Consequently, if you have the bandwidth, it might be better to have multiple PRIMARY requests to two distinct upstream LDM-s rather than use ALTERNATE requests.
An EXEC entry for pqact, if appropriate. For example
EXEC "pqact"
Note that you might have more than one such EXEC entry if, for example, you use the pqact configuration-files that come with the GEMPAK or McIDAS packages. For example
# Exec GEMPAK specific pqact(1) processing
EXEC "pqact -f NNEXRAD /usr/local/ldm/etc/GEMPAK/pqact.gempak_nexrad"
EXEC "pqact -f ANY-NNEXRAD /local/ldm/etc/GEMPAK/pqact.gempak_decoders"
An EXEC entry for rtstats if the LDM is a member of the Unidata IDD and is a gateway LDM for your institution. LDM statistics are the best way to monitor IDD performance and to identify problems. It is, therefore, crucial that all gateway LDM-s on the IDD report statistics. Also, data on LDM statistics is vital in preparing reports used to obtain funding to support the LDM system.
IDD statistics are displayed on the IDD rtstats webpages.
Workshop-specific instructions.
This file tells the pqact utility how to locally process various classes of data-products. Processing actions include filing the data-product, executing a local program, and piping the data-product to the standard input of a local program. If you're not going to process data-products locally, then you don't need to edit this file.
More information on this configuration-file.
Workshop-specific instructions.
This file tells the scour utility what old files should be deleted and when to delete them. This is useful if a pqact process is saving data-products as local files; and you want to keep only the most recent files to prevent the file system from becoming full. If you're not doing this, then you probably don't need to edit this file.
More information on this configuration-file.
Workshop-specific instructions.
Edit the crontab file of the LDM-user by, for example, executing the command
crontab -eas the LDM-user. Then
Add an entry to rotate the LDM logfiles by starting a new logfile every day at midnight, changing the names of the old logfiles, and ensuring that the number of logfiles doesn't grow without bound:
0 0 * * * bin/ldmadmin newlogMore information on rotating logfiles.
Add an entry to purge old files if necessary. If you are executing the pqact utility to decode incoming data-products into local files, then add an entry like the following to purge outdated files so that your disk doesn't become full:
0 1,4,7,10,13,16,19,22 * * * bin/ldmadmin scourThe above runs the scour program to remove too-old files every three hours. You might choose a different time interval.
Workshop-specific instructions.
Email for the LDM user can be generated by a crontab(1) entry or by someone trying to contact the LDM administrator at a site. Consequently, you should ensure than any email sent to the LDM user is forwarded to a responsible person. On most UNIX®-like systems (on which the sendmail(8) daemon is used to deliver email) this is done by having a line like the following:
in the file .forward in the LDM user's home-directory. This file must also be be owned by the LDM user and be world-readable. For security, this file should not be writable by anyone other than the LDM user.user@host
Although boot-time start-up procedures vary amongst operating systems, each can be tailored to start the LDM. It is best to start the LDM as late as possible in the boot process to avoid interfering with processes that could hang the system (e.g., the syslog daemon). One possible LDM script is:
export PATH=/bin:/usr/bin:/usr/etc:/usr/ucb
LDMHOME=/usr/local/ldm
LDMBIN=$LDMHOME/bin
LDMADMIN=$LDMBIN/ldmadmin
PQCHECK=$LDMBIN/pqcheck
PQCAT=$LDMBIN/pqcat
PQ=$LDMHOME/data/ldm.pq
case "$1" in
start)
echo 'Starting LDM system...'
if [ -x $LDMADMIN ] ; then
if su - ldm -c "$LDMADMIN isrunning"; then
echo "LDM system is already running."
else
if [ ! -f $PQ ] ; then
echo "Product-queue doesn't exist. Creating..."
if ! su - ldm -c "$LDMADMIN mkqueue"; then
echo "Aborting..."
exit 1
fi
else
#
# Test the product-queue for corruption.
#
if ! $PQCHECK -l /dev/null -q $PQ; then
case $? in
1) echo "System error checking product-queue. Aborting..."
exit 1
;;
2) echo "Adding writer-counter to product-queue..."
if ! $PQCHECK -F -q $PQ; then
echo "Aborting..."
exit 1
fi
;;
3) echo "Product-queue was incorrectly closed. " \
"Checking..."
if $PQCAT -s -l /dev/null; then
echo "Product-queue appears OK. "
echo "Clearing writer-counter..."
if ! $PQCHECK -F -q $PQ; then
echo "Couldn't clear counter. Aborting..."
exit 1
fi
else
echo "Product-queue appears corrupt."
echo "Renaming with '.bad' suffix and recreating..."
mv -f $PQ $PQ.bad
if ! su - ldm -c "$LDMADMIN mkqueue"; then
echo "Couldn't make product-queue. Aborting..."
exit 1
fi
fi
;;
4) echo "Product-queue is corrupt."
echo "Renaming with '.bad' suffix and recreating..."
mv -f $PQ $PQ.bad
if ! su - ldm -c "$LDMADMIN mkqueue"; then
echo "Couldn't make product-queue. Aborting..."
exit 1
fi
;;
esac
fi
fi
su - ldm -c "$LDMADMIN clean"
su - ldm -c "$LDMADMIN start"
fi
fi
;;
stop)
echo 'Stopping the LDM system.'
if [ -x $LDMADMIN ] ; then
su - ldm -c "$LDMADMIN stop"
fi
;;
esac
Note that some user-shells do not conform to the the UNIX standard and
will not understand the "if ! ..." expressions in the
above (e.g., SunOS 5.8's /bin/sh). You can test your
user-shell with the following command:
if ! false; then echo OK; fi
Instead of using the echo utility as above,
you might wish to use the logger utility
in order to write error-messages into the LDM logfile, e.g.,
Note that thelogger -p local0.err "Couldn't make product-queue. Aborting..."
-p option is system-dependent.
Consult the documentation on your operating system or with your system administrator for details on how to incorporate this script (or something similar) into the boot-time start-up procedure of your system.
Workshop-specific instructions.