[comp.sys.sun] SUMMARY: Cannot use cmdtool on NCD X-terminal in SunOS 4.1 with OLWM

sitongia@hao.ucar.edu (Leonard Sitongia) (06/05/91)

I'd asked for help regarding xdm:

me> Subject: Re: Cannot use cmdtool on NCD X-terminal in SunOS 4.1 with OLWM

me> I've been using an NCD X-19 terminal with xdm from MIT X11R4 displaying
me> cmdtool from OpenWindows 2.0 served from a Sun-4/280 running SunOS 4.0.3 for 
me> some time.  It is simply exec'd from the .openwin-menu.
me> 
me> After I upgraded the Sun to SunOS 4.1, I have been unable to run the
me> cmdtool on the Sun to display directly on the X terminal.  If I exec a
me> cmdtool which rlogins to the same Sun (in other words the same cmdtool
me> which fails but in this case does a rlogin to the same system that the 
me> cmdtool is running on), it suceeds (using two ttyp?'s, though).
me> 
me> The failing cmdtool appears normal, in that it opens ok, and echos input,
me> but will not execute it.
me> 
me> In any case, when the cmdtool is started up, the xdm-errors reports:
me> 
me> ttysw-TIOCSPGRP: Interrupted system call
me> 

I received several replies.  All indicated that I could use the setsid(8)
command to make the cmdtool the session leader.  That fixed the problem.

My thanks to all of you who took the time to read my posting.  Following
are extracts of the replies.

andrew> From: Andrew Rutherford <andrewr@ucs.adelaide.edu.au>

andrew> The problem is Sun's brain-dead implementation of {cmd,shell}tool.
andrew> It assumes it is attached to a terminal (usually a Sun console), and gets
andrew>   confused starting up under X without a terminal. If you try, you will
andrew>   find that cmdtool works fine if started from a terminal (ie, other
andrew>   session or an xterm, which works perfectly).
andrew> The real fix for this is to replace all occurences of "cmdtool" with
andrew>   "setsid cmdtool". setsid sets up the cmdtool as a process group leader,
andrew>   which solves the problem. Personally, I think this stinks. When I
andrew>   first got OW and xdm running together, this was my greatest stumbling
andrew>   block, thinking I'd stuffed up the environment or something.

barry> Cc: support@ncd.com
barry> Subject: from xpert: looks like the setsid problem
barry> From: Barry Davis <barry@ncd.com>
barry> 
barry> We saw your question on the internet.  Here are some hints for
barry> openwindows on the NCD.  Note the "setsid" in .openwin-menu.
barry> 
barry> Attached are some copies of the .xsession, .openwin-menu, and .cshrc files I
barry> use for running OpenWindows.  You can perform a diff on the .openwin-menu and 
barry> $OPENWINHOME/lib/openwin-menu to see what I changed; it's essentially the same
barry> except for the setsid -b stuff.

ian> From: Ian Angles <ia@st-andrews.ac.uk>
ian> 
ian> Wow! you got that far?? :-)
ian> 
ian> The immediate suspect is that the cmdtool isn't allocating it's session
ian> group or some other buzz term like that - I don't know the details.
ian> However, the fix that worked for me is to use setsid(8V) (with the -d
ian> option) to surround the cmdtool command line. I.e.
ian> 
ian> setsid -d cmdtool <options>