[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20020401: ** Env variables for ldmfail and ldm at boot (cont.)



>From: James T Brown <address@hidden>
>Organization: Michigan State University
>Keywords: 200204011731.g31HVHa18383 LDM ldmfail cron

Jim,

>I will try to work on one problem at a time...

Wise move :-)

>First - getting the LDM to start at boot with the proper
>environment exported to it.
>
>Here is a copy of my new start-up (/etc/init.d/ldmd) 
>script - pretty similar to what was discussed in the 
>earlier email.  I have also included a few debugging
>statements:
>
>
>> #!/sbin/sh
>> # $Id$
>> #
>> PATH=/bin:/usr/bin:/usr/etc:/usr/ucb:/usr/local/bin
>> MANPATH=/usr/share/man:/usr/local/man
>> LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
>> #
>> # LDM Settings
>> #
>> LDMHOME=/home/ldm
>> LDMBIN=$LDMHOME/bin
>> LDMLIB=$LDMHOME/lib
>> LDMMAN=$LDMHOME/man
>> #
>> DECODEBIN=$LDMHOME/decoders:/soft/nawips/bin/sol
>> DECODELIB=$LDMLIB:/soft/nawips/lib/sol

This line has a problem.  The expression $LDMLIB: will get interpreted
as one item.  What you want instead is:

DECODELIB=${LDMLIB}:/soft/nawips/lib/sol

>> #
>> UTILBIN=$LDMHOME/util
>> #
>> #
>> #
>> #
>> case "$1" in
>> 
>> 'start')
>>         if [ -x $LDMBIN/ldmadmin ] ; then
>>                 PATH=$PATH:$LDMBIN:$DECODEBIN:$UTILBIN; export PATH

This line has the same problem as the DECODELIB above.  It should read:

                 PATH=${PATH}:${LDMBIN}:${DECODEBIN}:${UTILBIN}; export PATH

>>                 MANPATH=$MANPATH; export MANPATH
>>                 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DECODELIB; export LD_LIBRA
> RY_PATH

This line has the same problem as the DECODELIB above.  It should read:

                 LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${DECODELIB}; export 
LD_LIBRARY_PATH

>>                 echo ""
>>                 echo "$LD_LIBRARY_PATH"
>>                 ldd /soft/nawips/bin/sol/dcnldn
>>                 echo ""
>>                 echo "starting $LDMBIN/rpc.ldmd using ldmadmin start."
>>                 echo ""
>>                 /bin/su - ldm -c "$LDMBIN/ldmadmin delqueue"
>>                 /bin/su - ldm -c "$LDMBIN/ldmadmin mkqueue"
>>                 /bin/su - ldm -c "$LDMBIN/ldmadmin start"
>>         fi
>>         ;;
>> 'stop')
>>         if [ -x $LDMBIN/ldmadmin ] ; then
>>                 $LDMBIN/ldmadmin stop
>>         fi
>>         ;;
>> esac

>When the script is invoked at start-up, the following occurs:

Until the environment variables are set correctly, all bets are off.

>> /lib:/usr/lib:/usr/local/lib:/home/ldm/lib:/soft/nawips/lib/sol
>>         libm.so.1 =>     /lib/libm.so.1
>>         libsocket.so.1 =>        /lib/libsocket.so.1
>>         libnsl.so.1 =>   /lib/libnsl.so.1
>>         libF77.so.4 =>   /soft/nawips/lib/sol/libF77.so.4
>>         libM77.so.2 =>   /soft/nawips/lib/sol/libM77.so.2
>>         libsunmath.so.1 =>       /soft/nawips/lib/sol/libsunmath.so.1
>>         libc.so.1 =>     /lib/libc.so.1
>>         libdl.so.1 =>    /lib/libdl.so.1
>>         libmp.so.2 =>    /lib/libmp.so.2
>>         /usr/platform/SUNW,Ultra-2/lib/libc_psr.so.1
>> 
>> starting /home/ldm/bin/rpc.ldmd using ldmadmin start.
>> 
>> Sun Microsystems Inc.   SunOS 5.7       Generic October 1998
>> MANPATH: Undefined variable
>> Sun Microsystems Inc.   SunOS 5.7       Generic October 1998
>> MANPATH: Undefined variable
>> Sun Microsystems Inc.   SunOS 5.7       Generic October 1998
>> MANPATH: Undefined variable
>> starting the LDM server...
>> ld.so.1: /soft/nawips/bin/sol/dcnldn: fatal: libF77.so.4: open failed: No su
> ch file or directory
>> ld.so.1: /soft/nawips/bin/sol/dcmetr: fatal: libF77.so.4: open failed: No su
> ch file or directory
>>
>>    ... [multiple messages deleted]...
>>
>> ld.so.1: /soft/nawips/bin/sol/dcmetr: fatal: libF77.so.4: open failed: No su
> ch file or directory
>> ld.so.1: /soft/nawips/bin/sol/dcmetr: fatal: libF77.so.4: open failed: No su
> ch file or directory
>> Apr 01 20:12:14 cirrus pqact[7737]: pbuf_flush (4) write: Broken pipe
>> Apr 01 20:12:14 cirrus pqact[7737]: pipe_dbufput: /soft/nawips/bin/sol/dcmet
> r-v0-b9-m24-t90-ssfmetar_sa.tbl-d/data/nawips/logs/dcmetr
>> Apr 01 20:12:14 cirrus pqact[7737]: pipe_prodput: trying again
>> Apr 01 20:12:14 cirrus pqact[7737]: pbuf_flush (4) write: Broken pipe
>> Apr 01 20:12:14 cirrus pqact[7737]: pipe_dbufput: /soft/nawips/bin/sol/dcmet
> r-v0-b9-m24-t90-ssfmetar_sa.tbl-d/data/nawips/logs/dcmetr

>I realize that my "NAWIPS" decoders and libraries are not installed in
>the standard locations, but Solaris should be able to handle this.

Where the NAWIPS decoders are installed doesn't matter; this is handled
by your PATH.  Your original problem was that the shared Fortran
library, libF77.so.4, could not be found.  The solution is correctly
setting LD_LIBRARY_PATH so that it can be found by the decoder executables.

>As 
>can be seen by the "ldd" statement in the start-up script, the library 
>given the trouble can certainly be seen by root, however the "rpc.ldmd" 
>processes (and subsequent calls to the "dcnldn" and "dcmetr" decoders) 
>started with the "/bin/su - ldm -c "$LDMBIN/ldmadmin start",command 
>lose track of the environment settings.

Again, the environment variable settings were incorrect.

>As was the case before, switching "/bin/su - ldm" to "/bin/su ldm"
>appears to have little change in the results.
>
>I can try to implement a shell script to encompass the environment
>variables and the commands such as you mentioned for the "ldmfail" 
>problem.  I can also setup some links to the libraries to mimic 
>installation in one of the default system locations, but I am 
>still more than a little curious why the above setup fails.  This 
>could come into play later as other non-LDM decoders are implemented.
>It might be nice for processes such as "rpc.ldmd" and "ldmfail" to 
>know of environment variables that are custom to a specific application 
>or site.  

After you modify your environment variable settings in the boot LDM
startup script, things should work fine.

>Thanks again...

Tom