-
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
Printer Passwords
- 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
>>
>>
Setup done on Printer:
Request an IP for the printer including the following kinds of information
To: request@ist.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
(Note: of 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)
* 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 on to cscf.cs if the printer is being served by print.cs
- Log on to mfcf.math if the printer is being served by print.math
Accounting Files
Notes there are
two kinds of accounting
- psif - common to all setups (the .acct file we will create is only used by this utility)
- lpquota_filter (the .tlog and .acct file we will create are both used by this utility)
- Logon to print.cs
- Create initial log files - we will being using both psif and lpquota_filter in this example
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
For our lpquota_filter example (
not needed if you are
only using psif)
- 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.cs 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
Printconf configuration
- Log into cscf.cs
- Read the man page
printconf-config
by running the command man printconf-config
on cscf.cs.
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, i.e.,
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
The previous example is sufficient to cause a printcap entry to be generated on
remote hosts, that is, other than print.cs if the printer is being driven by
print.cs. As an example, we consider the queue
ljp_maple1:
# ===== scg.math printers =================================================
#
# ljp_maple1 (ljp-maple.math) - SCG - Symbolic Computation Group
#
ljp_maple1
Aliases = ljp_maple ljp-maple ljp_dc2302
MasterQueueHost = print.cs
DviPrefilter = /software/lpr/servers/prefilter-dvips
PrintHeaderPage = suppress_with_user_override
PrintcapFiles = printers/ljp_maple1 devices/lj
The key difference is the
PrintcapFiles key. In this case it says printconf should include
some printcap fragments from the directory
printers/ljp_maple1
and
devices/lj
in the same
directory as the
printer_descriptions
file that the above description is in.
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
- If we are adding a print queue everywhere then edit the admin files on cscf.cs
- If we are adding a print queue on the region then just edit the regional file on any host in the region
- etc ...
Adding Quota
Note used only if we are using
lpquota_filters
Adding Sponsorship
Note used only if we are using
lpquota_filters
- 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:
Note used only if we are using
lpquota_filters
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)
We need to distribute the lpr_quota package with our changes to print.cs
- Log onto cscf.cs
- xh-dist-recurse lpr_quota
You are Done!
(PS - Xhier trivia, you can optionally use xh-dist2 to push the package from the master, host to host, on down to just print.cs)
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