Adding a Printer / queue

Setup for Linux

Ensure you are root or sudo’ed

 

Adding Your First Printer from the Command-Line

Run the lpadmin command with the -p option to add a printer to CUPS:

/usr/sbin/lpadmin -p printer -E -v device -m ppd

or

/usr/sbin/lpadmin -p printer -E -v device -P <directory to ppd file>

For a HP DeskJet printer connected to the parallel port this would look like:

/usr/sbin/lpadmin -p DeskJet -E -v parallel:/dev/lp1 -m deskjet.ppd

Similarly, a HP LaserJet printer using a JetDirect network interface at IP address 11.22.33.44 would be added with the command:

/usr/sbin/lpadmin -p LaserJet -E -v socket://11.22.33.44 -m laserjet.ppd

 

Managing Printer Classes from the Web Interface

The Web interface is located at:

http://localhost:631/admin

 

You may need to check CUPS (Common Unix Printer Services) is installed and running

By default cups installs the following directories:

/etc/cups: Configuration directory.

/var/spool/cups/: The spooler directory where print jobs are held for printing.

/var/spool/cups-pdf: The spooler directory where CUPS-generated PDF files are held for printing.

 

CUPS also installs an executable binary in /etc/init.d/ (or /etc/rc.d/init.d) called cups. This binary is started with the command:

/etc/init.d/cups start/stop/restart

 

Create a printer on linux the hard way.

1. To create a printer called mylp for the /dev/lp1 device, open the /etc/printcap file with your preferred text editor. The sd option tells the Linux printing daemon, lpd, where to temporarily place printed (spooled) files. The mx command, used with a value of 0, places no limit on the size of spooled files. Type an entry such as this:

 

mylp:\
:sd=/var/spool/lpd/mylp:\
:mx#0:\
:lp=/dev/lp1:

2. Save the entry, and then create the printer’s spool directory by using the mkdir command:

mkdir /var/spool/lpd/mylp

3. Make sure the directory lp has the correct group ownership and permissions by using the chgrp and chmod commands, as follows:

chgrp lp /var/spool/lpd/mylp
chmod 755 /var/spool/lpd/mylp

4. Test the printer entry with the lpr (line printer command) using the -P option to specify your newly created printer:

lpr -Pmylp test.txt

5. Your printer should activate and print the test document.

 

Setup for IBM AIX

For this operation you need to be logged in as root or sudo’ed

 

run smit.

-> Print Spooling

-> Aix Print Spooling

-> Add a Print Queue

Select options

*     hpJetDirect

*     Other (Select this if your printer type is not listed above)

*     generic      Generic Printer

*     2 Do NOT make this system a BOOTP/TFTP server

Enter name of queue in ONE of the Names of NEW print queues to add – select PostScript if not sure (e.g. HP4050_QUEUE)

Enter HOSTNAME of JetDirect Card (e.g. HP4050_PRN)

Leave port 9100 as that is nearly always right.

 

Create a printer on Aix the hard way.

 

1. Add the printer to /etc/hosts

10.0.0.111 HP4050

2. Add the print queue

Option a) Generic ASCII

     /usr/lib/lpd/pio/etc/piomkjetd mkpq_jetdirect -p 'generic' -D asc -q 'HP4050asc' -h 'HP4050' –x '9100'

where ‘HP4050asc’ is the queue name and ‘HP4050’ is the host name as specified in /etc/hosts

Option b) Generic Postscript

     /usr/lib/lpd/pio/etc/piomkjetd mkpq_jetdirect -p 'generic' -D ps -q 'HP4050ps' -h 'HP4050' –x '9100'

where ‘HP4050ps’ is the queue name and ‘HP4050’ is the host name as specified in /etc/hosts