Operating System - Linux
1752601 Members
4423 Online
108788 Solutions
New Discussion юеВ

Re: HP/UX to Linux migration - Printing questions

 
SOLVED
Go to solution
rmueller58
Valued Contributor

HP/UX to Linux migration - Printing questions

We are looking into migrating from HP/UX to a flavor of Linux in a year on one of our primary boxes that have a bunch of printing queues.

Currently under HP/UX most (98%) of the ques are defined using HPPI (jetadmin),

we generally use 4 printing command line options for each "quename"

Example:
Compressed
lp -dquename -oc -ovsi7.27 jobname
lp -dquename -oc -olandscape -ovsi5.45 jobname
Non-Compressed
lp -dquename -ovsi7.27 jobname
lp -dquename -olandscape -ovsi5.45 jobname

As I use HPPI or the subset "addqueue" command in my scripts to add queues to our HP/UX box, I will need to re-create approximately 250-300 physically networked printers..

Question:
What is the sequence of events for defining ques on Linux?

Is there a similar utility to add queues to the linux system?

I realize it has the LPD and CUPS product, but I lack any familiarity with these as the ease of use of the jetadmin/hppi system has never required I investigate it.

Does any one have a script to define printers to make it possible to select model scripts or something similar as I do now?

Any insight into this process would be appreciated. I am in the process of familiarizing myself with CUPS. I just don't know where to start..
7 REPLIES 7
Matti_Kurkela
Honored Contributor

Re: HP/UX to Linux migration - Printing questions

Depending on which flavor of Linux you pick, there are usually several printing systems to choose from. However, CUPS seems to be the common default choice.

CUPS has a web-based GUI, available at port 631 of the print server (in modern distributions, usually only localhost access allowed by default). There are also various X Window System-based GUIs, but their availability and functionality tends to vary among various Linux distributions.

In CUPS, printing destinations (queues) are defined using URL-style strings. The printing URL of a HP JetDirect printer will look like this:
socket://printername:9100

Instead of model scripts, CUPS uses PPD files to define printer capabilities. There are usually some PPD files pre-installed: the command "lpinfo -l -m" will list them. You can also supply your own PPD file: they are often available from the printer manufacturer (sometimes associated with Mac printer drivers) or from http://linuxprinting.org website.

To define a new printer queue using the command line (or to configure an existing one), the command is:
lpadmin -p [option(s)]

For example, to define a new printer "laser" using JetDirect at address 11.22.33.44, with a custom PPD file "laserjetNNNN.ppd", the command would be:

lpadmin -p laser -v socket://11.22.33.44:9100 -D "Description" -L "Room 123" -P laserjetNNNN.ppd

After defining the queue and associating it with a PPD file, you can then use "lpoptions -l" to list all the available PPD-file-based options for it. In addition to those, "man lp" lists some generic options, like "-o landscape" for landscape output.

You can then use lpadmin or lpoptions commands to set suitable default values:

lpadmin -p laser -o media=letter -o cpi=12
or
lpoptions -d laser -o media=letter -o cpi=12

With the lpoptions command, you can even define several "option sets" (called "instances" in CUPS jargon) for each printer, using a slash after the printer name. For example, you could define the defaults according to the settings you use the most (I'll assume non-compressed non-landscape here) for queue "laser", then define "laser/compressed", "laser/landscape" and "laser/compland" for the three other combinations.

To print, you could simply use "lp -dlaser jobname" to use the default settings, or "lp -dlaser/landscape jobname" to use another pre-defined set of options.

CUPS documentation is available at:
http://www.cups.org/documentation.php

I'll have to say the free documentation could be better. I think the CUPS developers would like the people to buy the book listed at their web page:
http://www.cups.org/book/index.php

MK
MK
rmueller58
Valued Contributor

Re: HP/UX to Linux migration - Printing questions

Have a test environment, trying to connect to the web interface, don't get browser reply any insight on correct definitions in the /etc/cups/cupsd.conf for the web interface??

Matti_Kurkela
Honored Contributor

Re: HP/UX to Linux migration - Printing questions

Please tell us the name and version of your Linux distribution, and the CUPS version too if possible.

Without this basic information it is very hard to know what might be wrong - some distributions customize the default settings of CUPS source distribution rather extensively.

MK
MK
rmueller58
Valued Contributor

Re: HP/UX to Linux migration - Printing questions

Matt, we are doing testing on Fedora FC5 and 6 and we will be using Redhat ES5 when we migrate.

Matti_Kurkela
Honored Contributor
Solution

Re: HP/UX to Linux migration - Printing questions

At least RHEL5 has this setting in /etc/cups/cupsd.conf by default:

# Only listen for connections from the local machine.
Listen localhost:631
Listen /var/run/cups/cups.sock

This means you must either:
- use CUPS configuration tools that use /var/run/cups/cups.sock to talk with the cupsd, or
- start the browser on your print server, then point it to http://localhost:631, or
- use SSH to forward the connection from your workstation to your print server:
$ ssh -L 1111:localhost:631 username@printserver
(new shell window on your workstation)
$ firefox http://localhost:1111

Eventually, you will want to change the "Listen localhost:631" to something like "Listen *.631" and add some more Allow lines to the various blocks in your cupsd.conf, to make cupsd accessible remotely. The default configuration is intended to be suitable for a laptop/desktop installation, where the cupsd serves only the host it's running on.

If you're familiar with Apache configuration files, you'll notice that cupsd.conf syntax is similar to Apache's httpd.conf syntax.

MK
MK
rmueller58
Valued Contributor

Re: HP/UX to Linux migration - Printing questions

Matt, that got the web interface up. I will have to muck with the product so I can get familiar before we migrate now.

rmueller58
Valued Contributor

Re: HP/UX to Linux migration - Printing questions

Matt, that got the web interface up. I will have to muck with the product so I can get familiar before we migrate now.