home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / vms / 13818 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  12.4 KB

  1. Path: sparky!uunet!ukma!wupost!usc!rpi!muvms3!boag
  2. From: boag@muvms3.bitnet (Bob Boag)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: DecNet RPC and Xwindows
  5. Message-ID: <116045@muvms3.bitnet>
  6. Date: 19 Aug 92 11:40:39 GMT
  7. References: <1247@esl.ESL.COM> <1992Aug18.185340.12605@nap.amoco.com>
  8. Organization: Marshall University
  9. Lines: 337
  10.  
  11. In article <1992Aug18.185340.12605@nap.amoco.com>, pgravel@nap.amoco.com (Philip L. Gravel) writes:
  12. > In article <1247@esl.ESL.COM>, jsd@esl.com (Jeff Dalton) writes:
  13. >  
  14. >> I'm trying to start an Xwindows process running on a remote node and
  15. >> have it displayed on my local node.  The catch is that I don't want to
  16. >> log into the remote node to start the process.  I'm attempting to use
  17. >> the DecNet Remote Command Execution facility, you know... the stuff that
  18. >> looks like the following:
  19. >> 
  20. >>   type RMT_NODE::"username password":"task=FILE.COM"
  21. > On the remote node where I want the Xwindows client process to run, I have
  22. > a command procedure named REM_DECTERM.COM which contains:
  23. > $       Set NoVerify
  24. > $       Server_Node = F$TrnLNm("Sys$Rem_Node","LNm$Job") - "::"
  25. > $       Client_Node = F$TrnLNm("Sys$Node","LNm$System")  - "::"
  26. > $       Set Display /Create /Node='Server_Node'
  27. > $       Create /Terminal=DECterm -
  28. >         /NoProcess -
  29. >         /Window_Attributes=( -
  30. >          Title="''Client_Node' DECterm", -
  31. >          Icon_Name="''Client_Node'" )
  32. > $       Set Display /Delete
  33. > $       Exit
  34. > Then on my local node, I enter:
  35. > $      TYPE client_node::"TASK=REM_DECTERM"
  36. > Of course, I have set up a symbol for this command.  Make sure all your
  37. > DECnet proxies and Session Manager security authorizations are set up
  38. > properly.
  39. > Phil
  40. > -----
  41. > Philip L. Gravel                      Internet: pgravel@nap.amoco.com
  42. > Amoco Corporation, Chicago, IL        Phone:    (312)856-3553
  43. > ----------
  44. > These opinions aren't worth the paper they're written on and
  45. > certainly don't reflect those of my employer.
  46.  
  47. I approached this in a similar fashion, but I wanted to be able to start
  48. various decwindows applications from a remote system, not just DECterm.
  49. Starting a DECterm was fine, but sometimes I wanted to be able to start
  50. Bookreader, FileView, Calendar, Clock, etc. So, I wrote the following command
  51. procedure which I use all of the time. It is called MU_REMOTE (MU stands for
  52. Marshall University, just in case anyone is interested).
  53.  
  54. I order to use this procedure, you need to do the following things (to make
  55. things easy, local node refers to your station and remote node refers to any
  56. remote DECnet node you wish to have execute a command for use - such as
  57. create/terminal, etc):
  58.  
  59. 1. You must have proxy access on the remote node.
  60.  
  61. 2. On your local node, you must use the Session Manager to Customize the
  62.    Security to allow connections from the remote node.
  63.  
  64. 3. Using either the Session Manager or FileView, create an application which
  65.    will activate the MU_REMOTE procedure and specify the node name and command
  66.    to perform. For example, if you wish to have a DECterm sent to you from a
  67.    node named MYVAX1, you could define the application command as:
  68.  
  69.    @mu_remote myvax1 "create/terminal=decterm/detached/window=(icon:myvax1)"
  70.  
  71. Note that this procedure expects to find either a DECnet object called
  72. MU_REMOTE or a file called MU_REMOTE.COM in your login directory on any remote
  73. system you are using. Defining a DECnet object will allow you to use this
  74. procedure on a system for access by many users without having a separate copy
  75. in everyone's login directory.
  76.  
  77. Also note that this procedure does both the sending of the request from the
  78. local system and the performing of the request on the remote system.
  79.  
  80. One final node, under FileView this procedure can ask for the remote system and
  81. command to perform (by displaying dialog boxes) if you don't specify them as
  82. paramters to the procedure, and it can display errors in pop-ups if necessary.
  83. If you encounter problems, try looking for NETSERVER.LOG in your login
  84. directory on the remote system - it may contain error messages which will
  85. indicate why a command failed to work properly.
  86.  
  87. Here it is. (Sorry if this is an old version of VMS_SHARE - it is the only one
  88. I could find handy.)
  89.  
  90. $! ------------------ CUT HERE -----------------------
  91. $!
  92. $! This archive created by VMS_SHARE Version 7.1-001  26-JUN-1989
  93. $!   On 19-AUG-1992 11:05:48.20   By user BOAG 
  94. $!
  95. $! This VMS_SHARE Written by:
  96. $!    Andy Harper, Kings College London UK
  97. $!
  98. $! Acknowledgements to:
  99. $!    James Gray       - Original VMS_SHARE
  100. $!    Michael Bednarek - Original Concept and implementation
  101. $!
  102. $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
  103. $! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
  104. $!
  105. $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
  106. $!       1. MU_REMOTE.COM;10
  107. $!
  108. $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
  109. $e="write sys$error  ""%UNPACK"", "
  110. $w="write sys$output ""%UNPACK"", "
  111. $ if f$trnlnm("SHARE_LOG") then $ w = "!"
  112. $ if f$getsyi("version") .ges. "4.4" then $ goto START
  113. $ e "-E-OLDVER, Must run at least VMS 4.4"
  114. $ exit 44
  115. $UNPACK: SUBROUTINE ! P1=filename, P2=checksum
  116. $ if f$search(P1) .eqs. "" then $ goto file_absent
  117. $ e "-W-EXISTS, File ''P1' exists. Skipped."
  118. $ delete/nolog 'f'*
  119. $ exit
  120. $file_absent:
  121. $ if f$parse(P1) .nes. "" then $ goto dirok
  122. $ dn=f$parse(P1,,,"DIRECTORY")
  123. $ w "-I-CREDIR, Creating directory ''dn'."
  124. $ create/dir 'dn'
  125. $ if $status then $ goto dirok
  126. $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
  127. $ delete/nolog 'f'*
  128. $ exit
  129. $dirok:
  130. $ w "-I-PROCESS, Processing file ''P1'."
  131. $ define/user sys$output nl:
  132. $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
  133. PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
  134. SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");
  135. buff:=CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(buff))
  136. ;LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
  137. BEGINNING_OF(buff));g:=0;LOOP EXITIF MARK(NONE)=END_OF(buff);x:=
  138. ERASE_CHARACTER(1);IF g = 0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x=
  139. "V" THEN APPEND_LINE;MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;
  140. IF x="+" THEN g:=1;ERASE_LINE;ENDIF;ELSE IF x="-" THEN g:=0;ENDIF;ERASE_LINE;
  141. ENDIF;ENDLOOP;p:="`";POSITION(BEGINNING_OF(buff));LOOP r:=SEARCH(p,FORWARD);
  142. EXITIF r=0;POSITION(r);ERASE(r);COPY_TEXT(ASCII(INT(ERASE_CHARACTER(3))));
  143. ENDLOOP;o:=GET_INFO(COMMAND_LINE,"output_file");WRITE_FILE(buff,o);
  144. ENDPROCEDURE;Unpacker;EXIT;
  145. $ delete/nolog 'f'*
  146. $ CHECKSUM 'P1'
  147. $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
  148. $ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
  149. $ ENDSUBROUTINE
  150. $START:
  151. $ create/nolog 'f'
  152. X$ !
  153. X$ !`009MU_REMOTE - Procedure for starting remote DECwindows applications
  154. X$ !
  155. X$ !`009This procedure performs both the sending of the request to a remote n
  156. Vode
  157. X$ !`009and servicing such a request from another node by examining the curre
  158. Vnt
  159. X$ !`009process mode. INTERACTIVE jobs are considered to be sending a remote
  160. X$ !`009request to another node for an application and NETWORK jobs will serv
  161. Vice
  162. X$ !`009remote application requests.
  163. X$ !
  164. X$ !`009This procedure also assumes it is running under FILEVIEW if the OWNER
  165. X$ !`009of this process is not null. Under FILEVIEW it will, if necessary,
  166. X$ !`009display pop-up windows to request information and display status.
  167. X$ !`009If the owner is null, for example it was run under the Session Manage
  168. Vr,
  169. X$ !`009the following parameters are used:
  170. X$ !
  171. X$ !`009P1 - remote node (creates a task-to-task communication to MU_REMOTE)
  172. X$ !`009P2 - command to send to remote node
  173. X$ !
  174. X$ begin:
  175. X$`009username = f$edit(f$getjpi(0,"username"),"trim")
  176. X$`009if (username .eqs. "DECNET") then eoj
  177. X$`009node = f$getsyi("nodename")
  178. X$`009mode = f$getjpi(0,"mode")
  179. X$`009if (mode .eqs. "INTERACTIVE") then goto interactive
  180. X$`009if (mode .eqs. "NETWORK") then goto network
  181. X$`009write sys$output "This procedure must run as an interactive job to"
  182. X$`009write sys$output "request remote applications, or as a network job"
  183. X$`009write sys$output "to service request. The current mode of ''mode'"
  184. X$`009write sys$output "is not supported."
  185. X$`009exit
  186. X$
  187. X$ interactive:
  188. X$`009set noon
  189. X$`009if (f$getjpi(0,"owner") .nes. "")
  190. X$`009   then fileview = "true"
  191. X$`009`009vue$suppress_output_popup
  192. X$`009   else fileview = "false"
  193. X$`009endif
  194. X$
  195. X$ i_get_node:
  196. X$`009if ((p1 .eqs. "") .and. fileview)
  197. X$`009   then vue$inquire_symbol "NODE Node:"
  198. X$`009`009vue$read node
  199. X$`009   else node = p1
  200. X$`009endif
  201. X$`009if (node .eqs. "")
  202. X$`009   then if (fileview)
  203. X$`009`009   then vue$popup_confirm "Node not specified. Try again?"
  204. X$`009`009`009vue$read okay
  205. X$`009`009`009if (okay .eqs. "NO") then exit
  206. X$`009`009`009p1 = ""
  207. X$`009`009`009goto i_get_node
  208. X$`009`009   else goto i_finish
  209. X$`009`009endif
  210. X$`009endif
  211. X$`009node = "''f$edit(node,"upcase")'"
  212. X$
  213. X$ i_get_command:
  214. X$`009if ((p2 .eqs. "") .and. fileview)
  215. X$`009   then vue$inquire_symbol "COMMAND Command:"
  216. X$`009`009vue$read command
  217. X$`009   else command = "''p2'"
  218. X$`009endif
  219. X$`009if (command .eqs. "")
  220. X$`009   then if (fileview)
  221. X$`009`009   then vue$popup_confirm "Command not specified. Try again?"
  222. X$`009`009`009vue$read okay
  223. X$`009`009`009if (okay .eqs. "NO") then exit
  224. X$`009`009`009p2 = ""
  225. X$`009`009`009goto i_get_command
  226. X$`009`009   else goto i_finish
  227. X$`009`009endif
  228. X$`009endif
  229. X$`009
  230. X$`009if (fileview)
  231. X$`009   then vue$popup_progress_box 20
  232. X$`009`009vue$set_task_label "Connecting to ''node'"
  233. X$`009endif
  234. X$
  235. X$ i_do_task:
  236. X$`009if (f$trnlnm("DECW$DISPLAY") .nes. "")
  237. X$`009   then define/user_mode sys$output nl:
  238. X$`009`009show display/symbols
  239. X$`009`009remote_node = decw$display_node`009! could be 0 too
  240. X$`009   else remote_node = "0"
  241. X$`009endif
  242. X$`009if (remote_node .eqs. "0") then remote_node = f$trnlnm("sys$node")
  243. X$`009node = node - "::"
  244. X$`009task_name = "''node'::""task=mu_remote"""
  245. X$`009open /write /error=i_no_connection link 'task_name'
  246. X$`009write link "''remote_node'"
  247. X$`009write link "''command'"
  248. X$
  249. X$ i_start_status:
  250. X$`009read/end_of_file=i_failed_start/time_out=10 link status
  251. X$`009if (status .nes. "START")
  252. X$`009   then msg = f$fao("!AS NOT started on !AS!/!AS",command,node,status)
  253. X$`009`009if (fileview)
  254. X$`009`009   then vue$popup_message "''msg'"
  255. X$`009`009endif
  256. X$`009   else if (fileview)
  257. X$`009`009   then vue$set_task_label "''node' ''command'"
  258. X$`009`009`009wait 00:00:10.00
  259. X$`009`009endif
  260. X$`009endif
  261. X$
  262. X$ i_final_status:
  263. X$`009read/end_of_file=i_failed_final/error=i_failed_final link status
  264. X$
  265. X$ i_display_final:
  266. X$`009if (status .nes. "STOP")
  267. X$`009   then msg = f$fao("!AS on !AS returned:!/!AS",command,node,status)
  268. X$`009`009if (fileview)
  269. X$`009`009   then vue$popup_message "''msg'"
  270. X$`009`009endif
  271. X$`009endif
  272. X$`009close/nolog link
  273. X$`009goto i_finish
  274. X$
  275. X$ i_finish:
  276. X$`009exit
  277. X$
  278. X$ i_failed_start:
  279. X$`009status = "Server did not respond with START status"
  280. X$`009goto i_display_final
  281. X$
  282. X$ i_failed_final:
  283. X$`009status = "Server did not respond with FINAL status"
  284. X$`009goto i_display_final
  285. X$
  286. X$ i_no_connection:
  287. X$`009message = f$message($status)
  288. X$`009msg = f$fao("Connection to !AS failed, returned:!/!AS",node,message)
  289. X$`009if (fileview) then vue$popup_message "''msg'"
  290. X$`009goto i_finish
  291. X$
  292. X$ network:
  293. X$`009set noverify
  294. X$`009on error then goto shutdown
  295. X$`009open /read /write link sys$net
  296. X$`009set noon
  297. X$`009purge /keep=3 netserver.log
  298. X$
  299. X$ n_remote_node:
  300. X$`009read /end_of_file=n_shutdown /error=n_shutdown link remote_node
  301. X$`009if (remote_node .eqs. "") then remote_node = f$trnlnm("sys$rem_node")
  302. X$`009remote_node = remote_node - "::" + "::"
  303. X$
  304. X$ n_get_command:
  305. X$`009read /end_of_file=n_shutdown /error=n_shutdown link command
  306. X$`009command = "''f$edit(command,"trim,uncomment")'"
  307. X$`009write link "START"
  308. X$`009write sys$output "Starting: ''command'"
  309. X$`009set noon
  310. X$`009define /nolog sys$error sys$output
  311. X$`009define decw$display 'remote_node'0.0
  312. X$`009set display /create /node='remote_node'
  313. X$`009on error then goto n_shutdown
  314. X$
  315. X$ n_perform_command:
  316. X$`009set noon
  317. X$`009''command'
  318. X$`009status = $status
  319. X$`009set on
  320. X$
  321. X$ n_return_status:
  322. X$`009if (status)
  323. X$`009   then write link "STOP"
  324. X$`009   else write link "''f$message(status)'"
  325. X$`009endif
  326. X$
  327. X$ n_shutdown:
  328. X$`009set display /nopermanent
  329. X$`009close/nolog link
  330. X$`009eoj
  331. $ CALL UNPACK MU_REMOTE.COM;10 756554368
  332. $ EXIT
  333. $! ------------------ CUT HERE -----------------------
  334.  
  335. -- 
  336. Bob Boag                                BITNET:   boag@marshall
  337. Senior Software Systems Analyst         Internet: boag@marshall.wvnet.edu
  338. Marshall University Computer Center     Phone:    (304)696-2624
  339. Huntington, WV 25755-5320               FAX:      (304)696-3601
  340.