[comp.sys.dec] Printing using DECnet: Ultrix <--> VMS

bemery@nmsu.edu (Bryan Emery) (10/03/90)

We have a DECstation running Ultrix and a MicroVAX II running VMS, both
running DECnet.  DEC tells me it should be possible to print directly from
one to the printers accessible by the other directly.  Does anyone know how
to do this?  They tell me I don't need additional software, either.  But,
my DECnet manuals don't say much about anything except using COPY or dcp.

I would greatly appreciate any suggestions, pointers, etc.  THANKS!!

Bryan Emery
Graduate Student
New Mexico State University

mwp@ubeaut.oz.au (Michael Paddon) (10/12/90)

From article <195@opus.NMSU.Edu>, by bemery@nmsu.edu (Bryan Emery):
> We have a DECstation running Ultrix and a MicroVAX II running VMS, both
> running DECnet.  DEC tells me it should be possible to print directly from
> one to the printers accessible by the other directly.  Does anyone know how
> to do this?  They tell me I don't need additional software, either.  But,
> my DECnet manuals don't say much about anything except using COPY or dcp.
> 
> I would greatly appreciate any suggestions, pointers, etc.  THANKS!!

The best way to set up shared printing is to hang the printer off a
DECserver and use LAT to get the jobs there. From the Ultrix end, this
entails simply enabling LAT and creating a printer in /etc/printcap
that specifies the terminal server and port to use.

If the printer is directly connected to a VMS box, dcp may be used to
submit print jobs from Ultrix. There are two possiblities, the first
being:

	dcp -P file vmsnode::

which will print the file on the default printer for the named VMS node.
This assumes that one can copy into the default DECnet account.

The other way is to set the input and output filters in /ect/printcap
to a script which looks a bit like this:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

#!/bin/sh
#
# Lpd filter to push print jobs on to a VMS printer
# 

VMSNODE=alicat
VMSQUEUE=sys\$print

########################################################

PATH=/usr/ucb:/usr/bin:/bin
export PATH

prog=`basename "$0"`
usage="usage: $prog [-c][-nlogin][-hhost][-wwidth][-lnum][-iindent][accounting]"

user=nobody
host=nowhere
account=/dev/null

for i
do
	case "$i" in
	-n)
		user="$i"
		;;
	-h)
		host="$i"
		;;
	-c|-w|-l|-i)
		# ignore options
		;;
	-*)
		echo "$prog: '$i': unrecognized option"
		echo "$usage"
		exit 1
		;;
	*)
		account="$i"
		;;
	esac
done

echo "`date`: $user@$host printing to VMS node $VMSNODE" >> "$account"

tmp="`hostname | sed -e 's/\..*$//'`_$$"
data="$tmp.dat"
batch="$tmp.com"

dcp - ${VMSNODE}::$data
dcp -S - ${VMSNODE}::$batch << EOF
$ print /queue=$VMSQUEUE /delete ${VMSNODE}::$data
$ delete $batch.*
EOF

exit 0

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Don't forget to set the lp device to /dev/null. This script copys the
file to the VMS machine and then submits a job to print and delete it.
The big gotcha is that the default DECnet account must have enough
privileges to submit a batch job.

Printing the other way, ie. VMS to Ultrix, is not as straightforward due
to VMS inadequacies.

						Michael

-------------------------------------------------------------------
|                     |     Internet: paddon@meo78b.enet.dec.com  |
|                     |     ACSnet:   mwp@ubeaut.oz.au            |
|  Michael Paddon     |     ACSnet:   mwp@munnari.oz.au           |
|                     |     EasyNet:  meo78b::paddon              |
|                     |     Voice:    +61 3 895 9392              |
-------------------------------------------------------------------