tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: Setting up multiple printer quickly
@ 2003-02-26 14:51 lawries
  0 siblings, 0 replies; only message in thread
From: lawries @ 2003-02-26 14:51 UTC (permalink / raw)


Thank you to all respondents. 
The job is completed!

Thank you to: Werner Rost, Phil Baldwin, Alan davis, Brian Mills and
Mark Deiss. Mark's reply is listed below because the answer was the
most comprehensive although all were along the same lines.

==== Mark Deiss ====

You do not mention if you are dealing with a mix of printers that may 
require different filters... 


while read LPNAME LPFILTER IPADDRESS 
do 
( 
echo "${LPNAME}:\\" # need to escape the escape 
echo " :af=/usr/adm/lpd/${LPNAME}.acct:\\" 
echo " :lf=/usr/adm/lpd/${LPNAME}.err:\\" 
echo " :if=/usr/lbin/${LPFILTER}:\\" 
echo " :of=/usr/lbin/${LPFILTER}:\\" 
echo " :sd=/usr/spool/lpd/${LPNAME}:\\" 
echo " :lp=:\\" 
echo " :mx#0:\\" 
echo " :pw#0:\\" 
.... 
.... 
echo " :pl#66:" # last descriptor for printer entry 
does not include a "\" 
# you get the idea, put in whatever printcap values you need.... 
) >> /tmp/printcap.build 

if [ ! -d /usr/spool/lpd/${LPNAME} ]; then 
mkdir /usr/spool/lpd/${LPNAME} 
chown daemon.daemon /usr/spool/lpd/${LPNAME} 
chmod 755 /usr/spool/lpd/${LPNAME} 
fi 

echo "IPADDRESS $LPNAME" >> /tmp/hosts.build 

done <<-! 
printer1 filter1 ipaddress1 
printer2 filter2 ipaddress2 
... 
... 
! 

Check the content of /tmp/printcap.build and /tmp/hosts.build. If they look 
correct, append printcap.build to /etc/printcap. append hosts.build to 
/etc/hosts 

cat /tmp/printcap.build >> /etc/printcap 
cat /tmp/hosts.build >> /etc/hosts 

Bounce the lpd daemon 

/sbin/init.d/lpd stop 
/sbin/init.d/lpd start 

run lpstat to see what is status on everything. 

Things that may require some tweaking are how you want to set up networked 
printers - some printers may be using port 515, some 9100... whatever. If 
there is a lot of variation, you may want to pass the service port flag in 
the read list (as defined in your /etc/services file) and use something like 
lp=@${LPNAME}/${LPSERVICE_PORT}. If you are using a single filter for all 
your printers, then obviously do not need an entry in your read list. 

You mention a new server - that may imply you have an old server that has 
all 200  spool entries, in that case you may be able to use the old system's 
printcap file and only need to build the spool directory. Some sites also 
like to nest the accounting and error log files in whatever path so you may 
need logic to build any directory structures for that. 

Lawrie


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-02-26 14:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-26 14:51 SUMMARY: Setting up multiple printer quickly lawries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox