[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

260.0. "Network problem?" by ASYLUM::JOHNSON (Pete Johnson - CSC/MA) Thu Jun 19 1986 12:46

    I had posted the base note in ASKENET and (as you can see) it was
    suggested that it be put in closet::command_procedures.  I'm putting
    it here, as well.
    
    The eventual intent of this thing is to allow me to give a filename
    that I want something done with on a remote node.  It will then copy
    the file and issue the DCL command on the remote node to do the work. 
    
    Right now I'm involved in 'stepwise refinement', just trying to get the
    local procedure to spark up the remote one and prove to me that it
    completes.  Receiving a VAXmail message would have suffuced, but
    apparently that won't work. 
    
    My basic problem is that I get either an 'unknown object' or 'network
    partner exited' message when I run it, so I'm not convinced that the
    remote procedure ran to completion. 
    
    The original note and appropriate replies are attached.
    
    Thanks for any help or examples of something that works (I've already
    seen TELL.COM - a more concise (simple) example would help more, I
    think). 
    
    Pete Johnson
    
    
    
            <<< RAINBW::SYS$SYSROOT:[NOTES$LIBRARY]ASKENET.NOTE;1 >>>
                            -< Ask the Easynet, V2 >-
================================================================================
Note 411.0                  Can't get this to work                     4 replies
ASYLUM::JOHNSON "Pete Johnson - CSC/MA"              41 lines  18-JUN-1986 08:22
--------------------------------------------------------------------------------


    The attached com file was distilled from TELL.COM which seems to work
    fine.  The problem is, this one doesn't.  If anyone has time to try it
    and let me know why it doesn't work, I'd sure appreciate it. 
    
    Pete
 
    $	if f$mode() .eqs. "network" then goto network
    $	on warning then goto exit
    $	close/err=10$  	rprint_server
    $10$:
    $!
    $!	Change node name to whatever you need (vs SHELTR)
    $!
    $	open/read/write rprint_server SHELTR::"0=RPRINT"
    $!
    $	wait 00:01:00
    $exit:
    $	close/error=20$ rprint_server
    $20$:
    $	exit
    $!
    $!===================================================
    $!
    $!	Network server piece
    $!
    $!===================================================
    $
    $network:
    $	set verify
    $	on warning then goto server_exit
    $	open/read/write rprint_link sys$net
    $!
    $!	Just do something that proves we got here
    $!
    $	mail nl: asylum::johnson/subj="RPRINT RAN!"
    $!
    $server_exit:
    $	close/error=30$ rprint_link
    $30$:
    $	logout/brief
================================================================================
Note 411.2                  Can't get this to work                        2 of 4
TBD::ZAHAREE "I hate Notes"                           7 lines  18-JUN-1986 09:23
                        -< There's enough information. >-
--------------------------------------------------------------------------------

    re .0
    
    Every time I've tried to send mail from a network process started
    like that, it died.  Had to resort to spawning mail.  Don't know
    why.
    
    - M
================================================================================
Note 411.3                  Can't get this to work                        3 of 4
JON::MORONEY "This space for rent."                   9 lines  18-JUN-1986 09:39
                       -< MAIL thinks it's a server... >-
--------------------------------------------------------------------------------

>    Every time I've tried to send mail from a network process started
>    like that, it died.  Had to resort to spawning mail.  Don't know
>    why.

That's because MAIL, when run under a network origin job, assumes it is
a remote MAIL server, and expects to receive a mail message from the remote
node and send it to a local user.  Use SPAWN.

-Mike
================================================================================
Note 411.4                  Can't get this to work                        4 of 4
CYCLPS::BAHN "You can't get there from here ..."     10 lines  18-JUN-1986 22:22
                      -< It may not be possible, but ... >-
--------------------------------------------------------------------------------

    Although it may not be possible to talk MAIL out of its assumptions
    (re .3), someone on CLOSET::COMMAND_PROCEDURES would know for sure.
    
    Terry
T.RTitleUserPersonal
Name
DateLines
260.1PASTIS::MONAHANFri Jun 20 1986 07:2646
	There was a change in MAIL between VMS V3 and V4 which makes
    MAIL not usable with a command string. Instead you can send mail
    directly from DCL by talking MAIL-11 protocol. The following is
    a fragment that does this, and that I have used with no problems.
    
    		Dave
    
$ user = "MONAHAN     "
$ node = "52354::"
$ object = "''node'""27="""
$ on error then goto exit
$ open /read /write link 'object'
$ write link "''f$getjpi("", "USERNAME")'"
$ write link user
$ read link status
$ v = 0
$ v[0,8] = 'f$cvui(0, 8, status)
$ v[8,8] = 'f$cvui(8, 8, status)
$ v[16,8] = 'f$cvui(16, 8, status)
$ v[24,8] = 'f$cvui(24, 8, status)
$ if v .ne. 1 then goto error
$ eot = " "
$ eot[0,7] = 0
$ write link eot
$ write link "security manager"
$ write link "%%AUDPACK ''f$logical(""SYS$NODE"")'"
$ copy 1.1 link
$ write link eot
$ read link status
$ v = 0
$ v[0,8] = 'f$cvui(0, 8, status)
$ v[8,8] = 'f$cvui(8, 8, status)
$ v[16,8] = 'f$cvui(16, 8, status)
$ v[24,8] = 'f$cvui(24, 8, status)
$ if v .ne. 1 then goto error
$exit:
$ set noon
$ delete 1.1;*
$ delete 1.2;*
$ close link
$ exit
$error:
$ read link message
$ if 'f$len(message) .eq. 1 then goto exit
$ goto error

260.2We're getting off the track ...ASYLUM::JOHNSONPete Johnson - CSC/MAFri Jun 20 1986 15:437
    OK, the example I used is taking us away from the root problem. I was
    MAILing to myself in order to prove to myself that the remote procedure
    ran to completion.  I'll change that (to just print a file or
    something) to circumvent the MAIL problem, which doesn't concern me
    right now. 
    
    I'll be back with status.
260.3Solution foundASYLUM::JOHNSONPete Johnson - CSC/MAFri Jun 20 1986 20:292
    I found the problem.  I have to compare f$mode with "NETWORK", not
    "network".
260.4Transparent Network MiscellaneaeTUNDRA::HARRIMANMon Jul 28 1986 14:2541
    re: .0
    
    It sounds like you are in the infamous "transparent network protocol"
    traps. one of the ways you can get relatively instantaneous information
    is by doing the following sort of thing:
    
    ("telling" node)
    
    $ TYPE OTHER"user password"::"TASK=DO_SOMETHING"
    
    
    ("OTHER")
    
    [DO_SOMETHING.COM]
    
    $ ASSIGN SYS$NET SYS$OUTPUT
    $ ! whatever you want to do
    $ EXIT (or LOGOUT)
    
    	the main point of this exercise is to open a transparent link
    back to the calling node from the other. You'll notice this sort
    of thing in the "TELL" procedures. This allows you to see what causes
    the "network process exited" errors, which are telling you that
    your command procedure died on the remote node for "some reason".
    
    	I did something like this in a hack that checked my mail machine's
    MAIL file from all of my other assorted accounts. What I wanted
    to do was to spawn a subprocess  (/NOWAIT) on whatever machine I
    was on, and run a remote network task on the mail machine to spawn
    MAIL, output any "You have ## new messages" to a file, and type
    the file back over the network to tell me if I got mail. Yes, it
    works, but I had to SPAWN the MAIL command with output and input
    command files. Overall it's a bit hacky, but hey, it works. And
    the TYPE command from the issuing node automatically gives you the
    output from the other node providing you assign SYS$NET to SYS$OUTPUT
    on the other node.
    
    Hope this is a pointer you can use...
    
    -pjh
    
260.5DEFINE SYS$INPUT too?38133::PUDERKarl PuderThu Mar 26 1987 21:1636
    I want to have the remote process both read and write from the network.
    DCL can do this by using OPEN/READ/WRITE, READ, and WRITE.  But I
    haven't been able to get it to pass this capability on to images run
    from DCL.
    
    Does anyone know how I can get this to work?  Is it specific to the
    particular interactive programs I have been using in my testing? 

    (node A, file callit.com)

    $ open/read/write net b::"0=doit"
    $loop:
    $! various commands including both
    $ read net line
    $! and
    $ write net line
    $! it will know enough about the program run on node B so that it
    $! knows when to read and when to write so it doesn't get jammed.
    $ ...
    $ close net
    $ exit

    (node B, file doit.com)

    $ open/read/write net sys$net
    $ define/user sys$input net
    $ define/user sys$output net
    $ mail	! (or any other interactive program)
    $ write net "All done."
    $ close net
    $ exit

    My experiments indicate that the program (mail in the example) is,
    in fact running interactively, but it is not reading from sys$net.

	:Karl.
260.6RE: .5, Not optimistic.DLO06::BEATTIEBliss is NOT ignorance (is it?)Thu Mar 26 1987 21:3217
    <*whew*>  Wish I could offer some encouraging words...
    
    With transparent DECNET, you MUST have matching sets of reads and
    writes from your "co-operating" processes.  It is very difficult
    to predict whether or not MAIL will READ or WRITE to SYS$whatever
    at any given instant, and how many times it will do one or the other
    in a row.  It is not possible to detect which it is doing from the
    remote process using transparent mode...
    
    I would say that creatively redefining SYS$OUTPUT: and SYS$INPUT:
    directly to SYS$NET: should produce desireable results in most cases,
    at least initially,  but you must be very careful to READ every
    time the remote process intends to WRITE, and WRITE every time the
    remote process intends to READ.  If you miss even once, you're HUNG.
    
    						Brian
    
260.7Use another example programJON::MORONEYLight the fuse and RUN!Thu Mar 26 1987 22:025
re .5: (using MAIL in network jobs)

Read the extracted notes in .0 about using MAIL for your test network program.

-Mike
260.8all but spawn38133::PUDERKarl PuderWed Apr 01 1987 14:576
    I've gotten things other than mail to work (like
    analyze/rms/interactive and elf) but I can't get spawn to work (taking
    input/output from/to the network connection), no matter what I tell the
    spawn to do.  It always says

%DCL-W-INVFILSPE, input or output file specification too long - shorten
260.9done38133::PUDERKarl PuderFri Apr 17 1987 16:424
    My original problem is solved, anyway.  I discovered that the program
    I was trying to get to work (FTP) wanted to see a linefeed character
    (not simply end-of-record) before it would process the input command
    line.