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

20000707: Starting LDM at boot with Solaris



Chris,

The xhost message you are getting is probably from the shell
sourcing the .cshrc or .profile environment when the
su - ldm is invoked for ldmadmin delqueue, mkquque
and start.

You probably have a command to run xhost + `hostname`:0 in
your shell environment.

Typically, you probably want some variables defined for
all your shell sessions (like setting your path), but some 
are only for interactive uses. Most .cshrc files have a test such as:

# All shell commands
...
if($?prompt == 0) exit
# commands/aliases for interactive shells
...

Typically, an interactive shell has a predefined prompt, such as '%'.
You really don't care about setting a prompt for a cron script etc,
so only after the prompt test, if you like your prompt to be
hennon@scooby[1]:
then you do that setting in the interactive part. For a non-interactive shell,
then prompt is not set when invoking the .cshrc, so the test will exit at
that point.

Hope this information provides you wil what you need to configure your
LDM shell environment.

Steve Chiswell



 
>From: address@hidden (Chris Hennon)
>Organization: UCAR/Unidata
>Keywords: 200007071837.e67IbET06980

>Hello.
>
>I'm using the following script to start the LDM at boot time on my Solaris
>5.7 machine:
>
>#! /bin/sh
>#
>PATH=/bin:/usr/bin:/usr/etc:/usr/ucb; export PATH
>LDMHOME=/usr/local/ldm
>LDMBIN=$LDMHOME/bin
>DECODEBIN=$LDMHOME/decoders
>UTILBIN=$LDMHOME/util
>
>case "$1" in
>start)
>        if [ -x $LDMBIN/ldmadmin ] ; then
>                /bin/su - ldm -c 'ldmadmin delqueue'
>                /bin/su - ldm -c 'ldmadmin mkqueue'
>#               /bin/su - ldm -c 'ldmadmin delsurfqueue'
>#               /bin/su - ldm -c 'ldmadmin mksurfqueue'
>                /bin/su - ldm -c 'ldmadmin start'
>        fi
>        ;;
>stop)
>        if [ -x $LDMBIN/ldmadmin ]; then
>                echo "Shutting down the LDM server"
>                /bin/su - ldm -c '$LDMBIN/ldmadmin stop'
>        fi
>        ;;
>esac
>
>I've created a hard link in my /etc/rc2.d to this script in /etc/init.d
>(S94ldmd).  When I reboot my machine, it starts the ldm successfully, but
>I get these 3 of this message (one for each ldmadmin invocation):
>
>xhost: unable to open display "shear:0.0"
>
>Can you tell a fluent UNIX but incompentent UNIX admin guy what is
>happening here and what this message means?  Can I get rid of it?  Thanks.
>
>Chris
>
>