NETSMB -- A network print spooler. NETSMB allows several VAX/VMS machines to share a single line printer without having to resort to getting a cluster. NETSMB is a user modified print symbiont that replaces the output and job_trailer routines. The output routine simply takes the formatted print job and shoves it across DECnet to the network object NETSMBSVR on the node specified in the /ON qualifier when you started the queue. When a flag is set by the job_trailer routine, the output routine tells the remote node to print the file and waits for a return status. If the user specifies /PARAMETER= the job will be printed on the queue specified, otherwise it will be sent to SYS$PRINT. Note: The DECnet connection is not maintained permanently, but is set up once per job. This solves many problems of trying to figure out when a node goes down, of keeping the network process on the printing end alive 'till it gets something to do, etc., etc... If NETSMB attempts to set up a connection that fails because the status SS$_UNREACHABLE is returned (i.e. the node is unreachable through DECnet), the queue waits for 5 minutes and tries again (and again...) till it gets through. (NOTE: There is a bug in this routine which causes the symbiont, but not the Job Controler, to crash, thus stopping the queue. The simple workaround for this problem is to restart the queue after the printing node becomes reachable. -rcy 4/24/87) The job_trailer routine waits 'till it sees PSM$K_CLOSE at which point it sets a flag which tells the remote server to go ahead and print the file. In all cases, the job_trailer routine passes control back to PSM$JOB_TRAILER. Please note that this approach *REQUIRES* that this queue be initialized with at least trailing job pages (job pages are set up by starting or initializing the queue /SEPARATE=() ). Unfortunately this was the only way to tell when we get to the end of a print job. On the receiving and printing end, the network object NETSMBSVR accepts the file, and essentially does a PRINT/NOFLAG/NOBURST/NOTRAILER/DELETE of the temporary file once it gets an entire print job. Currently the code waits for the job to finish printing before it sends a status back. This is so that the default decnet account doesn't overflow (actually, it will only help to cut down on this possibility, if you have 42 nodes sharing the same printer it would be quite easy to fill a disk!). If you really want everything to flush over immediately, NETSMB_SERVER.BLI has comments in it to tell you what to comment out to do so. You may also set up things so that NETSMBSVR is a known DECnet object. Make the appropriate change to NETSMB.BLI or NETSMB.MAR, and add NETSMBSVR to your permenant DECnet database as a known object. This will allow printing over the net without resorting to a default decnet account. If you have the MACRO source, replace all BLISS commands with MACRO commands. I use the following queue initializations in SYSTARTUP for the queues SYS$PRINT and REMOTE: $REMOTE: $ initialize/queue/default=(feed,flag,form=default)/processor=netsmb - /norecord_blocking/separate=(burst,flag,trailer)/on=Fenris - REMOTE $ goto done $ ! $SYS$PRINT: $ initialize/queue/generic=(REMOTE) SYS$PRINT $ goto done For those of you who don't have MMS, the following DCL code fragments illustrate what goes on. $ bliss/optimize=(level:3,speed) netsmb $ link netsmb $ copy netsmb.exe sys$system:netsmb.exe Note: you want to put netsmb.exe into sys$system: on every node that is going to be sending print jobs over the network. $ bliss/optimize=(level:3,speed) netsmb_server $ message netsmb_err $ link netsmb_server,netsmb_err $ copy netsmb_server.exe sys:[decnet]netsmb_server.exe $ copy netsmbsvr.com sys:[decnet]netsmbsvr.com Note: You want to put both netsmb_server.exe and netsmbsvr.com into the default DECnet account on each system with a printer that you want to print on. Also note, NETSMB depends on each printing node to have a default DECnet account. The queue setups on the printing end are pretty much standard. Note that if you have a /separate=(burst,flag,trailer) on the physical print queue, you will get an extra set of job pages that tell you the print job was called NETSMB_JOB_FILE.TMP and that it was printed by DECNET. There is no way to change the setting of job pages on a queue other than initializing the queue that way. There are three ways around this problem. 1) You can do the hacking that I didn't want to do and have NETSMB_SERVER (the receiving task) do a STOP/NEXT on the queue that puts job pages on the job, START a queue that does not put job pages on the job, print the job, reverse the procedure. 2) You can not put job pages on your physical printer queue. 3) You can tear off the extra job pages. We use option 3, because we figure that our operators are going to be separating the jobs anyway and we need job pages on the node with the printer. Good luck! If you have any problems or questions, I can be reached by email at chris%engvax.hac.com@usc-oberon.usc.edu. My work number is (213) 615-7445 and I can (usually) be counted on to be in between 8 and 4 Pacific time, excluding lunch. As with all public domain software, please feel free to give away this code to anyone who wants it, selling it will earn you the Weenie of the Year Award, and no warranties, implied, expressed, or verbal are granted. Though this software is in daily use here, use of this software is at your own risk, GM, Hughes, and I refuse any responsibility for any harm that comes to your system from use of this software. If you find any bugs, or add any features, I would greatly appreciate it if you would send the code back to me. -- Chris Yoder UUCP -- {allegra or ihnp4}!scgvaxd!engvax!chris Hughes Aircraft Internet -- chris%engvax.scg.hac.com@ymir.bitnet Company ARPA -- chris%engvax.scg.hac.com@oberon.usc.edu