Path: utzoo!attcan!uunet!cs.utexas.edu!ut-emx!mic From: mic@ut-emx.uucp (Mic Kaczmarczik) Newsgroups: comp.windows.x Subject: Re: OpenWindows shelltool/cmdtool under X-terminal Keywords: OpenWindows, shelltool/cmdtool, X-terminal Message-ID: <38553@ut-emx.uucp> Date: 22 Oct 90 18:36:08 GMT References: <2522@ux.acs.umn.edu> Organization: UT Austin Computation Center, Unix/VMS Services Lines: 102 In article <2522@ux.acs.umn.edu> aaron@ux.acs.umn.edu (Aaron Y.T. Cheung) writes: >We have: > >1. Suns running Sun OS 4.1 and OpenWindows 2.0 >2. NCD X-terminals under the control of xdm > > Now we want to run the OpenWindows environment (except the NeWS stuffs) >on the X-terminals, and with xdm as the login front end. Most of the >stuffs work except shelltool/cmdtool. I found an answer to this problem last week. The problem is that SunOS 4.1 uses POSIX job control, which changes the way programs need to dissociate themselves from the controlling terminal. Shelltool and cmdtool don't do this quite the way they need to under 4.1; I guess the OpenWindows developers never tried invoking these programs on an X terminal. According to the SunOS 4.1 release notes, the program /usr/etc/setsid can be used as a ``wrapper'' for programs that have this problem; if you change your shelltool/cmdtool invocation to /usr/etc/setsid -b ${OPENWINHOM}/bin/xview/shelltool [args] the problem should go away. On our systems, I even went so far as to make a shell script wrapper for these programs, so I wouldn't have to change any menu files; a shell archive of what I did is enclosed. Enjoy, --mic-- -------------------------------------------------------------------- #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'README' <<'END_OF_FILE' XDescription: X XIf you want to run cmdtool or shelltool via rsh(1) or from xdm(X11), Xyou need to establish a controlling terminal for the program to dissociate Xthe tty subwindow from. Otherwise, the program reports TIOCSPGRP errors, Xand the doesn't see any keyboard input. X XThe shell script in this directory uses setsid(2V) to establish a terminal Xsession ID for cmdtool/shelltool, which seems to do the trick. At least Xnow I can invoke shelltool from my window manager when logging in via Xxdm. X XInstallation: X XInstalling this hack requires that you move the cmdtool binary somewhere Xother than $OPENWINHOME/bin/xview. I put it in the subdirectory .bin for Xconvenience. X X cp cmdtool.sh $OPENWINHOME/bin/xview # copy the wrapper X mkdir $OPENWINHOME/bin/xview/.bin # create area for real binary X cd $OPENWINHOME/bin/xview/.bin # go there X mv ../cmdtool . # save real cmdtool X mv ../cmdtool.sh cmdtool # replace it with cmdtool.sh X ln -s cmdtool shelltool # remake symlink for shelltool END_OF_FILE if test 993 -ne `wc -c <'README'`; then echo shar: \"'README'\" unpacked with wrong size! fi # end of 'README' fi if test -f 'cmdtool.sh' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'cmdtool.sh'\" else echo shar: Extracting \"'cmdtool.sh'\" \(339 characters\) sed "s/^X//" >'cmdtool.sh' <<'END_OF_FILE' X#!/bin/sh X# X# @(#)cmdtool.sh 1.2 10/16/90 (cc.utexas.edu) /tmp_mnt/usr/share/src/public/sun/fixes/remote-cmdtool/SCCS/s.cmdtool.sh X# X# Wrapper for cmdtool and shelltool that establishes a session leader for X# the process. See setsid(8V) for details. X# Xexec /usr/etc/setsid -b ${OPENWINHOME-/usr/openwin}/bin/xview/.bin/`basename $0` "$@" END_OF_FILE if test 339 -ne `wc -c <'cmdtool.sh'`; then echo shar: \"'cmdtool.sh'\" unpacked with wrong size! fi # end of 'cmdtool.sh' fi echo shar: End of shell archive. exit 0 -- Mic Kaczmarczik gripe@{emx,ix1,ccwf} (Unix consulting, 1-0251) Unix / VMS / Cyber Services ...!cs.utexas.edu!ut-emx!mic (UUCP) UT Austin Computation Center mic@emx.utexas.edu (Internet) mic@utaivc (BITNET)