[comp.windows.x] Odd WM problem...something simple which I am forgetting

jc@raven.bu.edu (James Cameron) (03/08/91)

Running: SunOS 4.1.1
	 XDM(1)
	 Sun 4/xxx
	 SparcStation 1+



There must be a simple answer to this, but I can`t think of it...

I have a demo program I want to call from my WM's mouse menus.
The demo is a shell script (csh) which starts up some xterms and
executes a couple of C programs.  

This is the problem:  When I log on, the WM will not execute the
demo.  However, if I kill the WM and restart it, the demos work
just fine from mouse menus.  I have tried this in both OLWM and
TVTWM.  Here are the respective entries for both WM init files:


"Demos" MENU
        "Demo1 sentences-1"     exec /u4/home/jc/demo/demo 1 &
        "Demo1 sentences-2"     exec /u4/home/jc/demo/demo 2 &
"Demos" END PIN


and....


"Demo1"                 !"/u4/home/jc/demo/demo 1 &"
"Demo2"                 !"/u4/home/jc/demo/demo 2 &"


Here is the demo script:

#!/bin/csh

set com = $0

if ($#argv != 1) then 
   echo "Usage: $com:t data number"
   exit 1
endif

set NUM = $argv[1]


set DEMO_HOME   = /u4/home/jc/demo
set INPUT_HOME  = $DEMO_HOME/input

set DEMO_ARGS   = "-name DEMO -title DEMO"
set DEMO1_ARGS  = "-name DEMO1 -title DEMO1"

set IN_PIPE     = "$INPUT_HOME/pipe_number_$NUM"

set DEMO_PROG   = "$DEMO_HOME/demo1 $INPUT_HOME/sentences_$NUM"
set WAIT        = "$DEMO_HOME/demowait"
set DEMO1_PROG  = "$DEMO_HOME/demo2 $INPUT_HOME/sentences_$NUM"

xrdb -merge $DEMO_HOME/DEMODEFAULTS

xterm $DEMO_ARGS -e sh -c "$DEMO_PROG" &
sleep 5
xterm $DEMO1_ARGS -e sh -c "$IN_PIPE | $DEMO1_PROG; $WAIT" &



The demo works fine when I first start up if I execute from an
xterm...It just won't work upon the WM first startup.


Any help would be greatly appreciated.  Thanks.

JC


--
James Cameron  -  jc@raven.bu.edu

Signal Processing and Interpretation Lab, ECS Engineering Dept.
	Boston University, Boston MA
	Work: 617 353-2879
Information Technology
	Boston University, Boston MA
	work: 617 353-2780 ext. 338

		"But to risk we must, because the greatest hazard in life
	is to risk nothing.  For the man or woman who risks nothing, has
	nothing, does nothing, is nothing."

	(A quote from the eulogy for the late Christa McAuliffe.)

gildea@expo.lcs.mit.EDU (Stephen Gildea) (03/09/91)

    This is the problem:  When I log on, the WM will not execute the
    demo.  However, if I kill the WM and restart it, the demos work
    just fine from mouse menus.

My guess is that your programs depend on some part of your environment
that isn't set up yet when you fork your initial WM.  When the WM
forks your demo, it doesn't have the environment either.  But when you
start a new WM, you do so from an xterm which contains your complete
environment, so everything works.

Check the order you do things in your .xsession script (or whatever
startup script you use).

 < Stephen
   MIT X Consortium