--
MikeGore - 19 Apr 2005
How to setup printers to print from UNIX for CSCF
Notes:
- In this example we have created a printer, HP4300, whose network address is lj-dc3624 and whose queue name is lj_dc3624
Note the internet names cannot have '_' characters where queue names do!
- New print queues do not use cscf.cs:/software/printcap/data/printcap as we are using xhiered printconf package
- Most printers managed by CSCF printer are served by
print.cs
. By necessity if the printer uses a quota file it will be on the print server.
- I have updated several of the steps outline below to reflect print.cs and cscf.cs even though the lj_dc3624 print was originally installed on print.math and mfcf.math
- Use absolute Paths on ANY file edits! Ex: alias cdabs 'set _x = `absolute `!:1`; cd $_x:h; unset _x; lc'
- Example: say we have /.software/admin/printconf-1/config/admin as the root path of a file we want to edit.
We can run the command cd `echo /.software/admin/printconf-1/config/admin | absolute` which will place you in the correct directory for editing.
(Failing to do this can result in editing the wrong file!)
Documents:
- man printconf-config
- on cscf.cs
- /software /printcap/data/printcap/README
- /software/printcap/doc/printcap_source.5 and lpc_printcap.8
Setup done on Printer:
Request an IP for the printer including the following kinds of information
To: hostmaster@cnoc.uwaterloo.ca
Subject: Need IP on CS2net
Host Name: lj-dc3624
OS: Postscript
Type/Model: HP Laserjet 4300dtn
Ethernet Addr: 00:30:6E:D5:85:DC
IP: (I need this)
Segment Name/Base IP: 129.97.75
Room: DC3594
Contact: Yann D'Halluin
Mike Gore
Group: CS
Email: ydhallui@uwaterloo.ca
magore@uwaterloo.ca
Phone: 2956
6205
Setup Printer Password
(Note: or course change the subnet, contacts etc for your printer)
- Configure the printers initial IP address and network settings using the printers front panel MENU interface
- Connect to the printer using a web browser:
- Set printer password (SETTINGS->SECURITY web page)
Note use password found on one of the following host files based on your department
- cscf.cs: /software/cscf-admin/data/passwords/printers
- mfcf.math: /software/mfcf-admin_restricted/data/passwords/printers
- Add an entry to this password file with RCS using the absolute file paths (ie. pwd | absolute)
- cscf.cs: /.software/share/cscf-admin/data/passwords/printers
- mfcf.math: /.software/share/mfcf-admin_restricted/data/passwords/printers
Here are the changes after making the additions
RCS file: RCS/printers,v
retrieving revision 1.7
diff -r1.7 printers
251a252,258
>> lj-dc3624.cs
>> product=HP LaserJet 4300
>> mac=00306ED585DC
>> httpuser=any
>> include=MFCF-laserjet-any-user
>>
>>
* Enable SNMP read/write access
* Set Community Name: using the password found in the above file
* Get Community Name: using public
* Enable ONLY port 9100 printing - DISABLE ALL OTHER SERVICES
* Allow only access from remote hosts providing printing services such as print.math - or at the vary least restricting printing to the UofW domain
Verify printer setting (NETWORK->SECURITY->SETTINGS)
Authorization
Administrator Password: Set
Use the Administrator Password as the Set Community Name: Set
- or - see below and set *read only* for Enable SNMPv1/v2 read-only access
Jetdirect Certificate: Installed
Access Control: Enabled (Allow HTTP Connections)
* Set access control to either the printer server(s) addresses that are permitted to print
- or at minimum you want IP Addr 129.97.0.0 Mask 255.255.0.0 for the university
Web Interface
Encrypt All Web Communication: Disabled
Encryption Strength: Low (DES-56-bit, RC4-128-bit or 3DES-168-bit)
Enable SNMPv1/v2 read-only access: enabled
Status: Enabled
Get Community Name: Set
Set Community Name: Set
SNMPv3
Status: Disabled
Other Protocols
IPX/SPX: Disabled
AppleTalk: Disabled
DLC/LLC: Disabled
9100 Printing: Enabled
LPD Printing: Disabled
IPP Printing: Disabled
FTP Printing: Disabled
SLP Config: Disabled
mDNS: Disabled
Multicast IPv4:
Disabled RCFG: Disabled
Telnet: Disabled
FTP Firmware Update: Disabled
Creating a new printer under Unix:
Log onto
cscf.cs if the printer is being served by
print.cs or log onto
mfcf.math if the printer is being served by
print.math
Printcap Setup
- *Note printcap is going away and is being replaced by printconf-1 ! *
cd /software/printcap/data/printcap
Note: read the README file * )
Man pages are under: /software/printcap/doc:
printcap_source.5, lpc_printcap.8
The following files are updated using RCS:
Printers/lj_dc3624
Printers/lj_dc3624
create this NEW lj_dc3624 file from an similar printer (say lj_3047)
Use RCS command ci -l lj_dc3624 if this is the first edit
replace all lj_3047 references with lj_dc3624 (queue name)
replace all lj-3047 references with lj-dc3624 (network name)
Example:
#
# Model: HP LaserJet 4300dtn laser printer with duplexer
# Location: DC 2320
# Owner: Computer Science
# Purpose: Bulk printing on 8.5x11 paper by CS faculty, grads, and staff
#
# Note: Defaults to 1up, duplex, allows Nup and simplex
# Header pages suppressed by default
#
# -ZN is a work-around. It should be -Zdr -zN.
#
:lp=/dev/null:\
:sd=/software/lpr/spool/lj_dc3624:\
:lf=/software/lpr/spool/lj_dc3624/log:\
:ps=/software/lpr/spool/lj_dc3624/pstatus:\
:st=/software/lpr/spool/lj_dc3624/status:\
:af=/software/lpr/adm/lj_dc3624.acct:\
:lo=lock:ra=*:qc:rc:\
:rm=lj-dc3624.cs:po#9100:ar:\
:if=/software/lpr_quota/servers/lpquota_filter tcu=/software/psfilters/s
ervers/psif qf=/software/lpr_quota/data/quotas/lj_dc3624 -Xpal -a -ZNdr -XDPmrws
pt price=8b,8s,12d tlog=/software/lpr/adm/lj_dc3624.tlog:\
:of=/software/psfilters/servers/psof:\
:sf:sb:\
:br#9600:rw:\
:fc#0000374:fs#0000003:xc#0:xs#0040040:\
:mx#0:wh#1:\
:fx=lfpgdnt:ex:\\
:te=/software/ditroff/servers/dps.ne,l:\
:ne=/software/ditroff/servers/dps.ne,l:\
:de=/software/lpr/servers/prefilter-dvips,l:\
:ge=/software/psfilters/servers/psplot,l:\
Remote/lj_dc3624
- Notes: Remote is needed so that the queue can be used by hosts that have their printcap generated by this central printcap package.
create this NEW lj_dc3624 file from an similar printer (say lj_3047)
Use RCS command ci -l lj_dc3624 if this is the first edit
replace all lj_3047 references with lj_dc3624 (queue name)
replace all lj-3047 references with lj-dc3624 (network name)
Example:
#
# Remote to lj_dc3624
#
:fx=lfpgdnt:ex:mx#0:\
:ra=*:\
:lf=/software/lpr/spool/lj_dc3624/log:\
:te=/software/ditroff/servers/dps.ne,l:\
:ne=/software/ditroff/servers/dps.ne,l:\
:de=/software/lpr/servers/prefilter-dvips,l:\
:ge=/software/psfilters/servers/psplot,l:\
:sd=/software/lpr/spool/lj_dc3624:
Config/ *
- Add the new queue to Config/* for all hosts that should have access to the queue and that have their printcap generated by printcap rather the printconf-1.
- Note that files in Config are hostnames by default, but some are symlinks and some are hostgroups.
cacr.math:lj_dc3624
cacr2.math:lj_dc3624
print.math:lj_dc3624
Accounting Files
*Logon to print.cs
cd /software/lpr/adm/
touch lj_dc3624.acct lj_dc3624.tlog
Chown root:daemon lj_dc3624.*
Chmod 644 lj_dc3624.*
-rw-rw-r-- 1 root daemon 58 Mar 11 10:40 lj_dc3624.acct
-rw-rw-r-- 1 root daemon 313 Mar 11 10:40 lj_dc3624.tlog
- Add entries to the account file
- Note: normally the printer administrator does this but if you know, say that it will have the same entries as another printer you can copy the contents of the printer accounting file over to the new file as a starting point)
- Update: /software/lpr_quota/data/quotas (in this case we borrow ljp_cs )
ln -s ljp_cs lj_dc3624
chown root:daemon lj_dc3624
- Note: The actual quota and billing information ends up in on print.math in the file /software/lpr_quota/data/quotas/lj_dc3624 (In this case a simlink to lj_cs-1) the hostname groups mentioned in this file are found in files under the path /software/lpr_quota/data/hostname_groups
Printcap continued
cd /software/printcap/data/printcap
Note: we will be updating RCS files so we use the absolute path for /software/printcap/data/printcap
Update the following RCS files:
Aliases
Connections
- Added line "lj_dc3624 print.math"
Devicetypes
Config/print.math
- Added lines # DC 3624: new CS printer room lj_dc3624
Build printcap:
- ./lpc_printcap print.math
(creates printcap files from source, see: /software/printcap/doc/printcap_source.5)
Verify
(This gets a copy called Fetchedprintcap)
diff Fetchedprintcap/print.math Printcap/print.math
(Check results - we should just see our changes or perhaps recient changes as well)
Install:
Printconf configuration
Settting a nondefault_printer
Admin group example
- We want a non default printer in an administrative group of machines
- Log onto host that controls the admin group - ie. MFCF or CSCF
cd /software/printconf-1/config/admin
ls -l
*Note:* We must find the absolute root path for nondefault_printers file ÃÂÃÂ needed for RCS!
Result: nondefault_printers -> /.software/admin/printconf-1/config/admin/nondefault_printers
- cd `echo software/admin/printconf-1/config/admin | absolute`
- follow steps in next section
Local group example
- We want a nondefault_printer in a local group ( local to just one machine )
- Log onto host that controls the local group - ie. MFCF or CSCF
cd /software/printconf-1/config/local
ls -l
Note: absolute root path for nondefault_printers file RCS!
Result: printer_descriptions -> /.software/local/printconf-1/config/local/printer_descriptions
- cd `echo /.software/local/printconf-1/config/local | absolute`
- follow steps in next section
Create an RCS directory if the isn't one
umask 022 (see note about umask)
mkdir RCS
chmod a+rX RCS (see note about umask)
- Create an initial RCS file (this creates the RCS copy of our existing file)
Notes assuming we have a file called nondefault_printers in the current directory and our freshly created RCS directory we need to make the initial RCS copy of nondefault_printers as well
ci -l nondefault_printers </dev/null
produces:
RCS/nondefault_printers,v <-- nondefault_printers
initial revision: 1.1
done
Note the file is in fact in the checked out state so do not check it out again
Edit nondefault_printers file:
- co -l nondefault_printers (warning if the RCS file was just created skip this step!)
- add a line with the queue name ie lj_dc3624
- ci -u nondefault_printers
- add a comment saying we added a lj_dc3624
- CTRL D ÃÂÃÂ to exit
Edit printer_descriptions file:
- Check out
- co -l printer_descriptions (warning if the RCS file was just created skip this step!)
- add lines:
lj_dc3624
MasterQueueHost = print.math
QuotaControl = yes
DviPrefilter = /software/lpr/servers/prefilter-dvips
* Check back in
ci -u printer_descriptions
add a comment saying we added a lj_dc3624
CTRL D
Xhier printconf-1 to test
xh-install printconf-1
Check the queue
lpq -Plj_dc3624
*You should see:*
Spool queue: lj_dc3624
Remote(print.math):
no entries
Administation
Adding Quota
Adding Sponsorship
- Q Where do you put a printername to show that it is sponsored?
A /software/accounts-master/data/sponsors/.Config/printing
Adding a computer to a hostname group:
Log onto cscf.cs
cd /software/lpr_quota
- Change a hostname group cd config/admin/hostname_groups
- Checkout group file (example _scicomnt) co -l _scicomnt
*Result:*
RCS/_scicomnt,v --> _scicomnt
revision 1.13 (locked)
done
- Edit group (and add an entry) vi _scicomnt
*Check in group file
ci -u _scicomnt
*Result:*
RCS/_scicomnt,v <-- _scicomnt
new revision: 1.14; previous revision: 1.13
enter log message, terminated with single '.' or end of file:
>> added scicom28
>> .
- Run the command make_lpquota_hostgroups
/ software/lpr_quota/servers/make_lpquota_hostgroups -v
Result:
make_lpquota_hostgroups FYI: _cgl: same
make_lpquota_hostgroups FYI: _crypto: same
make_lpquota_hostgroups FYI: _dbnt: same
make_lpquota_hostgroups FYI: _icrnt: same
make_lpquota_hostgroups FYI: _mfcf: same
make_lpquota_hostgroups FYI: _scicomnt: mine
make_lpquota_hostgroups FYI: _vlsi: same
make_lpquota_hostgroups FYI: _wheat: same
To optionally push things out FAST (ie not wait until xhier does its weekly update)
(see last section to find out how we know what machines to do this on)
Log onto cscf.cs
Distribute lpr_quota to Pythagoras.math:
xh-dist2 pythagoras.math lpr_quota
Log onto Pythagoras.math
Distribute lpr_quota to Leopold.math (ie print.math):
xh-dist2 leopold.math lpr_quota
You are Done!
Xhier questions
How do we know where a printer is served from?
- In this example we look at lj_dc3624 (if this printer had been installed later on it would be served by print.cs)
A: lpq -P lj_dc3624 (check who serves the print queue)
*Result:*
Spool queue: lj_dc3624
Remote(print.math):
no entries
*Notes: *
- print.math is leopold.math
- xh-decsendants appears to be broken (ie try xh-decsendants lpr_quota on cscf.cs)
- xh-dist-hosts is used by xh-decsendants
xh-dist-hosts -p lpr_quota -h leopold.math -F
*Result:*
shared pythagoras.math
structure pythagoras.math
arch pythagoras.math
admin pythagoras.math
fpa pythagoras.math
getwd pythagoras.math
man_pages pythagoras.math
ALL pythagoras.math
*Observations: *
Recall previously the hostname_groups folder in the xhier admin area /software/lpr_quota/config/admin/hostname_groups
pythagoras.math is the next link
xh-dist-hosts -p lpr_quota -h pythagoras.math -F
Result:
shared sun560
structure sun560
arch sun560
admin mfcf.math
fpa sun560
getwd sun560
man_pages sun560
ALL mfcf.math sun560
*Observations: *
Recall previously the hostname_groups folder in the xhier admin area /software/lpr_quota/config/admin/hostname_groups
mfcf.math is the next link
xh-dist-hosts -p lpr_quota -h mfcf.math -F
Result:
shared sun560
structure sun560
arch sun560
fpa sun560
getwd sun560
man_pages sun560
ALL sun560
Observations:
No admin - the buck stops here - mfcf.math is where we run the command from
Additional notes:
See software/xhier/data/access-rights for the file xh-dist-hosts consults