awips2/rpms/awips2.upc/Installer.ldm/patch/init.d/edex_ldm
ucar-tmeyer 4f090d7a40 LDM Build RPM Updates
------------------------------
Moved the Installer.ldm to awips2.upc (previously in the nativelib repo) and combined from two separate ldm rpms to one
Updated build of LDM to 6.13.14
lookupRPM.sh - added awips2-ldm here and gave it the new path to component.spec
rpms/build/x86_64/build.sh - uncomment buildRPM awips2-ldm
completely updated the component.spec file to build with the paths we wanted
2022-09-22 12:35:17 -07:00

71 lines
1.3 KiB
Bash
Executable file

#!/bin/bash
#
# edex_ldm: This starts and stops the LDM on EDEX
#
# chkconfig: 35 99 0
# description: edex_ldm starts/stops LDM software for AWIPS II
#
LDM_INSTALL="/awips2/ldm"
PATH=/awips2/python/bin:/awips2/notification/bin:/awips2/java/bin:/awips2/tools/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:${LDM_INSTALL}/bin:${LDM_INSTALL}/decoders:${LDM_INSTALL}/util
# Source function library.
. /etc/init.d/functions
RETVAL=0
LDM_USER=awips
function create_queue() {
if [[ ! -f ${LDM_INSTALL}/var/queues/ldm.pq ]]
then
echo -ne "\nCreating LDM queue:\t"
su ${LDM_USER} -lc "ldmadmin mkqueue" > /dev/null 2>&1 && success || failure
if [[ ${myRetVal} -ne 0 ]]
then
return ${myRetVal}
fi
echo
fi
return 0
}
function clean_ldm() {
echo -ne "Cleaning LDM:\t"
su ${LDM_USER} -lc "ldmadmin clean" > /dev/null 2>&1 && success || failure
myRetVal=$?
if [[ ${myRetVal} -ne 0 ]]
then
return ${myRetVal}
fi
echo
create_queue
return 0
}
case $1 in
'start')
create_queue
su ${LDM_USER} -lc "ldmadmin start"
;;
'stop')
su ${LDM_USER} -lc "ldmadmin stop"
;;
'restart')
su ${LDM_USER} -lc "ldmadmin restart"
;;
'clean')
su ${LDM_USER} -lc "ldmadmin clean"
;;
*)
echo "usage: $0 {start|stop|restart|clean}"
RETVAL=1
;;
esac
exit $RETVAL