From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 30-AUG-1990 12:16:37.93
To:	MRGATE::"ARISIA::EVERHART"
CC:	
Subj:	Re: run/detached

Received:  by crdgw1.ge.com (5.57/GE 1.70)
	 id AA07781; Thu, 30 Aug 90 11:47:33 EDT
Received: From UCBVAX.BERKELEY.EDU by CRVAX.SRI.COM with TCP; Thu, 30 AUG 90 07:51:34 PDT
Received: by ucbvax.Berkeley.EDU (5.63/1.42)
	id AA18421; Thu, 30 Aug 90 07:44:30 -0700
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 30 Aug 90 12:35:22 GMT
From: sunquest!alpha.sunquest.com!gavron@uunet.uu.net  (Ehud Gavron)
Organization: Sunquest VMS Internals, Tucson AZ
Subject: Re: run/detached
Message-Id: <7021@sunquest.UUCP>
References: <900829193841.20206d81@SLC.SLAC.STANFORD.EDU>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

In article <900829193841.20206d81@SLC.SLAC.STANFORD.EDU>, LSC@SLC.SLAC.STANFORD.EDU (Lou Sanchez-Chopitea) writes...
#Hi,
#	I am having a proble with run/detached. I am attempting to get
#decw$mail running on our 8810 host and get the output on my VAXStation 2000.
[.COM file deleted]
# 
#	All well and good, the process comes up on my display, but does not
#look like I customized it before.
[...]
# 
#	It would seem that all the logical names have not been defined. I
#don't see any qualifiers for this in the run (process) docs. Any ideas ?

	   Detached processes don't normally have a CLI (Command Language
	Interpreter) like DCL with them.  Thus, they don't execute
	startup procedures like SYS$SYLOGIN and also don't get logical
	names like SYS$SCRATCH, SYS$LOGIN, SYS$LOGIN_DEVICE, and other
	such job logicals.

	   In order to get these, you need to map a CLI (run loginout) and
	define logicals (give it a login procedure).

	   I am enclosing a (modified) version of a command file I
	use here.  You call it with p1 being the application name,
	p2 being the node, and p3 the transport.  If the last two
	are not given, it will try to parse them out of the ACCPORNAM
	field of the TTY (which works spectacularly with TGV MultiNet)
	to use TCP/IP, or attempt to locate a DECNET nodename.

	MultiNet users can also start the application by issuing
	an    rsh vax  @procedure appname  node  tcpip     command.

$!-------a cut-here line for the DCL-impaired --------------------------------
$!!!!! Run DECW$* applications remotely.   gavron@sunquest.com     'f$verify(0)
$!
$ node_default  = "VESTA"
$ trans_default = "TCPIP"
$ domain = "SUNQUEST.COM"
$!
$ app   = "sys$system:decw$''p1'.exe"
$ node  = "''p2'"
$ trans = "''p3'"
$!
$ if node .eqs. "" .and. trans .eqs. "" .and. f$trnlnm("TT") .nes. ""
$   then
$     source = f$edit(f$getdvi("TT","TT_ACCPORNAM"),"UPCASE,COLLAPSE")
$     dom1 = f$element(1,".",source)
$     dom2 = f$element(2,".",source)
$     if "''dom1'.''dom2" .eqs. domain 
$       then
$         node = f$element(0,".",source)
$         trans= "TCPIP"
$       else
$         if f$element(0,":",source) .nes. "" 
$           then
$             node = f$element(0,":",source)
$             trans= "DECNET"
$           endif
$       endif
$   endif
$ if node .eqs. ""  then node  = node_default
$ if trans .eqs. "" then trans = trans_default
$!
$ if f$search(app) .eqs. "" .and. "''p1'" .nes. "DECTERM"
$   then
$     write sys$output "%''file'-F-FNF, File not found /''app'/"
$     eoj
$   else
$     login    = f$trnlnm("SYS$LOGIN")
$     filespec = "''login'''p1'.COM"
$     open/write out 'filespec'
$     write out "$ set noon"
$     write out "$ set nover "
$     user  = f$getjpi(0,"USERNAME")
$     pname = "''user'_''app'"
$     pname = f$extract(0,15,pname+"               ")
$     write out "$ set process/name=""''pname'"" "
$     write out "$ set display/create/node=''node'/trans=''trans'"
$     write out "$ me = f$environment(""PROCEDURE"")
$     write out "$ delete 'me';*"
$     if p1 .nes. "DECTERM" 
$       then
$	  login_dev = f$trnlnm("SYS$LOGIN_DEVICE")
$	  login_dir = f$trnlnm("SYS$LOGIN")
$	  scratch = f$trnlnm("SYS$SCRATCH")
$	  write out "$ define sys$Login_device ""''login_dev'"" "
$	  write out "$ define sys$login ""''login_dir'"" "
$         write out "$ define sys$scratch ""''scratch'"" "
$         write out "$ run ''app'"
$       else
$         write out "$ pname = f$getjpi(0,""PRCNAM"")+""_D""
$         write out "$ create/terminal/big/proc='pname'/detach"
$       endif
$     write out "$ eoj"
$     close out
$     set process/priv=detach
$     run sys$system:loginout.exe/input='filespec'/output=nl: -
      /page=20000/detach
$   endif
$ eoj
$!---------another cut-here line for the DCL-impaired---------------------

#=========================================================================
#Lou Sanchez-Chopitea                +  SSSSSS  L         AAAAAA   CCCCCC
#InterNet: lsc@slc.slac.stanford.edu +        S L        A      A C


	Ehud

/----------------------------------------------------------------------------\
| Ehud Gavron, Systems analyst  | gavron@vesta.sunquest.com      (Internet)  |
| Sunquest Information Systems  | uunet!sunquest!gavron          (UUCP)      |
| 930 N. Finance Center Drive   | gavron@lampf                   (BITNET)    |
| Tucson, Arizona, 85710        | (602)722-7546/885-7700 x.2546  (AT&Tnet)   |
|----------------------------------------------------------------------------|
|           your cute quote here                                             |
\----------------------------------------------------------------------------/

