From: gavin@sorokin.anu.edu.au (Gavin K. Longmuir)
Newsgroups: comp.protocols.appletalk
Subject: CAP's lwsrv with Mac and PC spooling (a workin example)
Date: 15 Nov 92 23:28:45 GMT
Organization: Australian National University
Reply-To: gavin@sorokin.anu.edu.au (Gavin Longmuir)
NNTP-Posting-Host: 150.203.76.12
Organisation: Research School of Social Sciences, Australian National University

Hi all, I've seen a few people posting to this newsgroup about certain
configuation problems with lwsrv spooling. So here is a overview of a
working version for Macintoshes and PC's (remember to compile with
-DPASS_THUR if you want PC spooling). Best of luck. A copy of this document
can be found on anonymous ftp site sorokin.anu.edu.au.

Gavin.


------

#!/bin/sh
### sample start servers file (copy to /usr/local/lib)
### start from '/etc/rc.local'

LOGd=/tmp/.aufs.log
LOGf=/tmp/.gaufs.log
LOGm=/tmp/.motd.log
CAP=/usr/local/cap
LIB=/usr/local/lib

MOTDFILES="/etc/cap.motd.1 /etc/cap.motd.2 /etc/motd"

AUFSLWLOG="-X /tmp/.cap.sockets"
LWARGS="-a ${LIB}/adicts -f ${LIB}/LWFonts ${AUFSLWLOG}"
LWARGSII="-a ${LIB}/adicts -f ${LIB}/LWPlusFonts ${AUFSLWLOG}"
LWARGSIIfg="-a ${LIB}/adicts -f ${LIB}/LWIIfgFonts ${AUFSLWLOG}"

AUFSARGS="-l ${LOGd} -V /etc/atalkvols -U 60 -A /etc/cap.monitor \
 -r /etc/cap.readme ${AUFSLWLOG}"
AUFSGARGS="-l ${LOGf} -V /etc/atalkvols.g -U 10 -G common -i 15"

#
# Start aarpd first for Native EtherTalk
#
nice --5 ${CAP}/aarpd "le0" "MYZONE"

#
# allow atis to startup before other CAP programs
#
nice --5 ${CAP}/atis

#
# Make this 15 seconds if using aarpd
#
sleep 15

nice --5 ${CAP}/asyncad

if [ -f ${LOGd} ] ; then
	rm -f ${LOGd}
fi

nice -5 ${CAP}/motd -l ${LOGm} -n "MYSERVER MOTD" ${MOTDFILES}

nice --5 ${CAP}/aufs -n "MYSERVER" ${AUFSARGS}
nice -5 ${CAP}/aufs -n "MYSERVER Guest" ${AUFSGARGS}

# macuser must be run from a tty device
if [ "`tty`" -ne "/dev/console" ] ; then
	${CAP}/macuser MANAGERACCT
fi

${CAP}/snitch -S -f "SUN SparcStation 1+ SunOS 4.1.2" -l lwsrv
${CAP}/timelord -n "MYSERVER Clock"

nice --5 ${CAP}/lwsrv -n "Graunt Mac Spooler" -p lw.graunt ${LWARGSII}
nice -5 ${CAP}/printqueue -a "Graunt Mac Spooler" graunt /var/spool/lpd/grauntlp
nice --5 ${CAP}/lwsrv -n "Graunt PC Spooler" -P -p grauntPC ${LWARGSII}

------

# /etc/printcap entry for lwsrv connected laserwriter
# Enable Printing on X's LaserWriter II NT "graunt"
graunt|lw.graunt|Graunt LaserWriter II NT (Mac Spool) [Postscript]:\
	:lp=/var/spool/lpd/graunt.log:\
	:sd=/var/spool/lpd/grauntlp:\
	:pw#85:pl#73:sf:\
	:af=/var/adm/lpd_acct:\
	:lf=/var/adm/lpd_errs:\
	:if=/usr/local/lib/psif.graunt:
grauntPC|Graunt LaserWriter II NT (PC Spool) [Postscript]:\
	:lp=/var/spool/lpd/graunt.log:\
	:sd=/var/spool/lpd/grauntlp:\
	:pw#85:pl#73:sf:\
	:af=/var/adm/lpd_acct:\
	:lf=/var/adm/lpd_errs:\
	:if=/usr/local/lib/psif.grauntPC:

-----

# /etc/cap.printers
lw.graunt=Graunt:LaserWriter@SOMEZONE

-----

#! /bin/csh -fb
# /usr/local/lib/psif.graunt
#	macintosh version
# sample line printer filter for the laserwriter
#

umask 0
set name="lwsrv spooler"
set host="MYSERVER"

top:
	if ($#argv > 0) then
		switch ($argv[1])
		case -n:
			shift argv
			if ($#argv > 0) then
				set name = $argv[1]
				shift argv
			endif
			goto top
		case -h:
			shift argv
			if ($#argv > 0) then
				set host = $argv[1]
				shift argv
			endif
			goto top
		default:

			shift argv
			goto top
		endsw
	endif

echo "Printing Postscript" > /var/spool/lpd/grauntlp/status
cat | /usr/local/cap/papif -p lw.graunt -n "$name" -h "$host"

exit(0)

-----

#! /bin/csh -fb
# /usr/local/lib/psif.grauntPC
#	IBM PC version
# sample line printer filter for the laserwriter
#

umask 0
set name="lwsrv spooler"
set host="MYSERVER"

top:
	if ($#argv > 0) then
		switch ($argv[1])
		case -n:
			shift argv
			if ($#argv > 0) then
				set name = $argv[1]
				shift argv
			endif
			goto top
		case -h:
			shift argv
			if ($#argv > 0) then
				set host = $argv[1]
				shift argv
			endif
			goto top
		default:

			shift argv
			goto top
		endsw
	endif

echo "Printing Postscript" > /var/spool/lpd/grauntlp/status
tr -d '' | /usr/local/cap/papif -p lw.graunt -n "$name" -h "$host"

exit(0)

-----

> ls -lFg /usr/local/lib/adicts
-rw-r--r--  1 root     staff       25884 Jun 15 13:57 LaserPrep3.1
-rw-r--r--  1 root     staff       28647 Jun 15 13:57 LaserPrep3.3
-rw-r--r--  1 root     staff       28365 Jun 15 13:57 LaserPrep4.0
-rw-r--r--  1 root     staff       28605 Jun 15 13:57 LaserPrep5.1
-rw-r--r--  1 root     staff       29892 Jun 15 13:57 LaserPrep5.2
-rw-r--r--  1 root     staff       35085 Jun 15 13:57 LaserPrep7.0

-----

-- 
       *                     Gavin Longmuir - General Dog's Body and Programmer
    *    *               Demography Program, Research School of Social Sciences
       *                    Australian National University, Canberra, AUSTRALIA
Voice: +61 6 249 0530  FAX: +61 6 257 1893  InterNet: Gavin.Longmuir@anu.edu.au       *      UUCP: {uunet,ubc-vision,ukc,prlb2}!munnari!coombs.anu.edu.au!gavin
Newsgroups: comp.protocols.appletalk