Содержание
openSUSE® supports printing with many types of printers, including remote network printers. Printers can be configured manually or with YaST. For configuration instructions, refer to Раздел 14.4, «Setting Up a Printer». Both graphical and command line utilities are available for starting and managing print jobs. If your printer does not work as expected, refer to Раздел 14.8, «Troubleshooting».
CUPS (Common Unix Printing System) is the standard print system in openSUSE.
Printers can be distinguished by interface, such as USB or network, and printer language. When buying a printer, make sure that the printer has an interface (like USB or parallel port) that is available on your hardware and a suitable printer language. Printers can be categorized on the basis of the following three classes of printer languages:
PostScript is the printer language in which most print jobs in Linux and Unix are generated and processed by the internal print system. If PostScript documents can be processed directly by the printer and do not need to be converted in additional stages in the print system, the number of potential error sources is reduced.
Although these printer languages are quite old, they are still undergoing expansion to address new features in printers. In the case of known printer languages, the print system can convert PostScript jobs to the respective printer language with the help of Ghostscript. This processing stage is referred to as interpreting. The best-known languages are PCL (which is mostly used by HP printers and their clones) and ESC/P (which is used by Epson printers). These printer languages are usually supported by Linux and produce an adequate print result. Linux may not be able to address some special printer functions. Except for HP developing HPLIP (HP Linux Imaging and Printing), there are currently no printer manufacturers who develop Linux drivers and make them available to Linux distributors under an open source license.
These printers do not support any of the common printer languages. They use their own undocumented printer languages, which are subject to change when a new edition of a model is released. Usually only Windows drivers are available for these printers. See Раздел 14.8.1, «Printers without Standard Printer Language Support» for more information.
Before you buy a new printer, refer to the following sources to check how well the printer you intend to buy is supported:
The OpenPrinting home page with the printer database. The database shows the latest Linux support status. However, a Linux distribution can only integrate the drivers available at production time. Accordingly, a printer currently rated as «perfectly supported» may not have had this status when the latest openSUSE version was released. Thus, the databases may not necessarily indicate the correct status, but only provide an approximation.
The Ghostscript Web page.
/usr/share/doc/packages/ghostscript-library/catalog.devices
List of included drivers.
The user creates a print job. The print job consists of the data to print plus information for the spooler, such as the name of the printer or the name of the printer queue, and optionally, information for the filter, such as printer-specific options.
At least one dedicated printer queue exists for every printer. The spooler holds the print job in the queue until the desired printer is ready to receive data. When the printer is ready, the spooler sends the data through the filter and back-end to the printer.
The filter converts the data generated by the application that is printing (usually PostScript or PDF, but also ASCII, JPEG, etc.) into printer-specific data (PostScript, PCL, ESC/P, etc.). The features of the printer are described in the PPD files. A PPD file contains printer-specific options with the parameters needed to enable them on the printer. The filter system makes sure that options selected by the user are enabled.
If you use a PostScript printer, the filter system converts the data into printer-specific PostScript. This does not require a printer driver. If you use a non-PostScript printer, the filter system converts the data into printer-specific data. This requires a printer driver suitable for your printer. The back-end receives the printer-specific data from the filter then passes it to the printer.
There are various possibilities for connecting a printer to the system. The configuration of the CUPS print system does not distinguish between a local printer and a printer connected to the system over the network. For more information about the printer connection, read the article CUPS in a Nutshell in the Support Database at http://en.opensuse.org/SDB:CUPS_in_a_Nutshell.
Changing Cable Connections in a Running System | |
---|---|
When connecting the printer to the machine, do not forget that only USB devices can be plugged in or unplugged during operation. To avoid damaging your system or printer, shut down the system before changing any connections that are not USB. |
PPD (PostScript printer description) is the computer language that describes the properties, like resolution, and options, such as the availability of a duplex unit. These descriptions are required for using various printer options in CUPS. Without a PPD file, the print data would be forwarded to the printer in a «raw» state, which is usually not desired. During the installation of openSUSE, many PPD files are preinstalled.
To configure a PostScript printer, the best approach is to get a suitable
PPD file. Many PPD files are available in the package
manufacturer-PPDs
, which is automatically
installed within the scope of the standard installation. See
Раздел 14.7.2, «PPD Files in Various Packages» and
Раздел 14.8.2, «No Suitable PPD File Available for a PostScript Printer».
New PPD files can be stored in the directory
/usr/share/cups/model/
or added to the print system
with YaST as described in
Раздел 14.4.1.1, «Adding Drivers with YaST». Subsequently, the
PPD file can be selected during the printer setup.
Be careful if a printer manufacturer wants you to install entire software packages. First, this kind of installation may result in the loss of the support provided by openSUSE and second, print commands may work differently and the system may no longer be able to address devices of other manufacturers. For this reason, the installation of manufacturer software is not recommended.
YaST can be used to configure a local printer that is directly connected to your machine (normally with USB or parallel port) and to set up printing with network printers. It is also possible to share printers over the network. Further information about printing (general information, technical details, and troubleshooting) is available in Глава 14, Printer Operation.
In YaST, click
+ to start the printer module. By default it opens in the view, displaying a list of all printers that are available and configured. This is especially useful when having access to a lot of printers via the network. From here you can also and configure local printers.Usually a local USB printer is automatically detected. There are two possible reasons why a USB printer is not automatically detected:
The USB printer is switched off.
The communication between printer and computer is not possible. Check the cable and the plugs to make sure that the printer is properly connected. If this is the case, the problem may not be printer-related, but rather a USB related problem.
Configuring a printer is basically a three-step process. First specify the connection type, then choose a driver, and name the printing queue for this setup.
For many printer models, several drivers are available. When configuring
the printer, YaST defaults to the one marked
recommended
as a general rule. Normally it is not
necessary to change the driver—the recommended
one should produce the best results. However, if you want a color printer
to print only in black and white, it is most convenient to use a driver
that does not support color printing, for example. If you experience
performance problems with a PostScript printer when printing graphics, it
may help to switch from a PostScript driver to a PCL driver (provided
your printer understands PCL).
If no driver for your printer is listed, you can try to select a generic driver with an appropriate standard language from the list. Refer to your printer's documentation to find out which language (the set of commands controlling the printer) your printer understands. If this does not work, refer to Раздел 14.4.1.1, «Adding Drivers with YaST» for another possible solution.
A printer is never used directly, but always through a print queue. This ensures that simultaneous jobs can be queued and processed one after the other. Each printer queue is assigned to a specific driver, and a printer can have multiple queues. This makes it possible to set up a second queue on a color printer that prints black and white only, for example. Refer to Раздел 14.1, «The Workflow of the Printing System» for more information about print queues.
Процедура 14.1. Adding a New Local Printer¶
Start the YaST printer module with
+Click
in the screen
If your printer is already listed under Specify the
Connection
, proceed with the next step. Otherwise, try to
or start the .
Enter the vendor name and the model name into the input box under
Find and Assign a Driver
and click .
Choose the driver marked as recommended that best matches your printer. If no suitable drivers is displayed
check your search term
broaden your search by clicking
add a driver as described in Раздел 14.4.1.1, «Adding Drivers with YaST»
Specify the Default paper size
Enter a unique name for the printer queue in the
field.The printer is now configured with the default settings and ready to use. Click
to return to the view. The newly configured printer is now visible in the printers list.If no suitable driver is available in the Раздел 14.3, «Installing the Software».
dialog when adding a new printer, no PPD (PostScript Printer Description) file for your model is available. For more information about PPD files, refer toGet PPD files directly from your printer vendor or from the driver CD of a PostScript printer. For details, see Раздел 14.8.2, «No Suitable PPD File Available for a PostScript Printer». Conversely, you can also find PPD files at http://www.linuxfoundation.org/en/OpenPrinting/, the «OpenPrinting.org printer database». When downloading PPD files from OpenPrinting.org, keep in mind that it always shows the latest Linux support status, which is not necessarily met by openSUSE.
Процедура 14.2. Adding a PPD file
Start the YaST printer module with
+Click
in the screen
Click Find and
Assign a Driver
section
Enter the full path to the PPD file into the input box under
Make a Printer Description File Available
or choose
the file from a dialog box by clicking on
Click Add New Printer
Configuration
screen.
In order to directly use this PPD file, proceed as described in Процедура 14.1, «Adding a New Local Printer». Otherwise, click .
By editing an existing configuration for a local printer you can not only change basic settings as connection type and driver, but also adjust the default settings for paper size, resolution, media source, etc. You can change the identifier of the printer by altering the printer descriptions.
Процедура 14.3. Editing a Local Printer
Start the YaST printer module with
+In the
screen, choose a local printer from the list and click .Change the connection type or the driver as described in Процедура 14.1, «Adding a New Local Printer». This should only be necessary in case you have problems with the current configuration.
Make this printer the default by checking
.
Adjust the default settings by clicking +
sign. Change the
default by clicking on an option. Apply your changes by clicking
Network printers are not detected automatically. They must be configured manually using the YaST printer module. Depending on your network setup, you can print to a print server (CUPS, LPD, SMB, or IPX) or directly to a network printer (preferably via TCP). Access the configuration view for network printing by choosing
from the left pane in the YaST printer module.In a Linux environment CUPS is usually used to print via the network. The simplest setup is to only print via a single CUPS server which can directly be accessed by all clients. Printing via more than one CUPS server requires a running local CUPS daemon that communicates with the remote CUPS servers.
Процедура 14.4. Printing via a Single CUPS server
Start the YaST printer module with
+Launch the
screen from the left pane.Check
and specify the name or IP address of the server.Click
to make sure you have chosen the correct name or IP address.Click OK to return to the
screen. All printers available via the CUPS server are now listed.Процедура 14.5. Printing via multiple CUPS servers
Start the YaST printer module with
+Launch the
screen from the left pane.Check
Specify which servers to use under General
Settings
. You may accept connections from all networks
available, from the local network, or from specific hosts. If you
choose the latter option, you need to specify the hostnames or IP
addresses, as well.
Confirm by clicking
and then when asked to start a local CUPS server. After the server has started you will return to the screen. Click to see the printers detected by now. Click this button again, in case more printer are to be available.If your network offers print services via print servers other than CUPS, start the YaST printer module with
+ and launch the screen from the left pane. Start the and choose the appropriate type. Ask your network administrator for details on configuring a network printer in your environment.Printers managed by a local CUPS daemon can be shared over the network and so turn your machine into a CUPS server. Usually you share a printer by enabling CUPS' so-called «browsing mode». If browsing is enabled, the local printer queues are made available on the network for listening to remote CUPS daemons. It is also possible to set up a dedicated CUPS server that manages all printing queues and can directly be accessed by remote clients. In this case it is not necessary to enable browsing.
Процедура 14.6. Sharing Printers
Start the YaST printer module with
+Launch the
screen from the left pane.Select
. For more detailed configuration, additional options are available:Check
and enable browsing mode by also checking .the network interface to be used by the CUPS server. If you want to share your printers via specified network interfaces, add those in the input box below.
In case you like to restrict access to your CUPS server to certain networks or IP addresses, specify these via the two input boxes.
Click
to restart the CUPS server and return to the screen.Regarding CUPS and firewall settings, see http://en.opensuse.org/SDB:CUPS_and_SANE_Firewall_settings.
A network printer can support various protocols, some of them even concurrently. Although most of the supported protocols are standardized, some manufacturers modify the standard. Manufacturers then provide drivers for only a few operating systems. Unfortunately, Linux drivers are rarely provided. The current situation is such that you cannot act on the assumption that every protocol works smoothly in Linux. Therefore, you may have to experiment with various options to achieve a functional configuration.
CUPS supports the socket
,
LPD
, IPP
and
smb
protocols.
Socket refers to a connection in which the plain
print data is sent directly to a TCP socket. Some of the socket port
numbers that are commonly used are 9100
or
35
. The device URI (uniform resource identifier)
syntax is:
socket://IP.of.the.printer
:port
,
for example: socket://192.168.2.202:9100/
.
The LPD protocol is described in RFC 1179. Under this protocol,
some job-related data, such as the ID of the printer queue, is sent
before the actual print data is sent. Therefore, a printer queue must
be specified when configuring the LPD protocol. The implementations of
diverse printer manufacturers are flexible enough to accept any name
as the printer queue. If necessary, the printer manual should indicate
what name to use. LPT, LPT1, LP1 or similar names are often used. The
port number for an LPD service is 515
. An example
device URI is lpd://192.168.2.202/LPT1
.
IPP is a relatively new protocol (1999) based on the HTTP protocol.
With IPP, more job-related data is transmitted than with the other
protocols. CUPS uses IPP for internal data transmission. The name of
the print queue is necessary to configure IPP correctly. The port
number for IPP is 631
. Example device URIs are
ipp://192.168.2.202/ps
and
ipp://192.168.2.202/printers/ps
.
CUPS also supports printing on printers connected to Windows shares.
The protocol used for this purpose is SMB. SMB uses the port numbers
137
, 138
and 139
.
Example device URIs are
smb://user:password@workgroup/smb.example.com/printer
,
smb://user:password@smb.example.com/printer
, and
smb://smb.example.com/printer
.
The protocol supported by the printer must be determined before
configuration. If the manufacturer does not provide the needed
information, the command nmap (which comes with the
nmap
package) can be used to ascertain the
protocol. nmap checks a host for open ports. For
example:
nmap -p 35,137-139,515,631,9100-10000 printerIP
CUPS can be configured with command line tools like lpinfo, lpadmin and lpoptions. You need a device URI consisting of a back-end, such as parallel, and parameters. To determine valid device URIs on your system use the command lpinfo -v | grep ":/":
# lpinfo -v | grep ":/" direct usb://ACME/FunPrinter%20XL direct parallel:/dev/lp0
With lpadmin the CUPS server administrator can add, remove or manage print queues. To add a print queue, use the following syntax:
lpadmin -pqueue
-vdevice-URI
-PPPD-file
-E
Then the device (-v
) is available as
queue
(-p
), using the
specified PPD file (-P
). This means that you must know
the PPD file and the device URI to configure the printer manually.
Do not use -E
as the first option. For all CUPS
commands, -E
as the first argument sets use of an
encrypted connection. To enable the printer, -E
must be
used as shown in the following example:
lpadmin -p ps -v parallel:/dev/lp0 -P \ /usr/share/cups/model/Postscript.ppd.gz -E
The following example configures a network printer:
lpadmin -p ps -v socket://192.168.2.202:9100/ -P \ /usr/share/cups/model/Postscript-level1.ppd.gz -E
For more options of lpadmin, see the man page of
lpadmin(8)
.
During printer setup, certain options are set as default. These options can be modified for every print job (depending on the print tool used). Changing these default options with YaST is also possible. Using command line tools, set default options as follows:
First, list all options:
lpoptions -p queue
-l
Example:
Resolution/Output Resolution: 150dpi *300dpi 600dpi
The activated default option is identified by a preceding asterisk
(*
).
Change the option with lpadmin:
lpadmin -p queue
-o Resolution=600dpi
Check the new setting:
lpoptions -p queue
-l
Resolution/Output Resolution: 150dpi 300dpi *600dpi
When a normal user runs lpoptions, the settings are
written to ~/.cups/lpoptions
. However,
root
settings are written
to /etc/cups/lpoptions
.
To print from the command line, enter lp -d
queuename
filename
, substituting the
corresponding names for queuename
and
filename
.
Some applications rely on the lp command for printing.
In this case, enter the correct command in the application's print
dialog, usually without specifying filename
,
for example, lp -d
queuename
.
A number of CUPS features have been adapted for openSUSE. Some of the most important changes are covered here.
After having performed a default installation of openSUSE,
SuSEFirewall2 is active and the network interfaces are configured to be
in the External Zone
which blocks incoming traffic.
More information about the SuSEFirewall2 configuration is available in
Раздел “SuSEfirewall2” (Глава 13, Masquerading and Firewalls, ↑Руководство по безопасности) and at
http://en.opensuse.org/SDB:CUPS_and_SANE_Firewall_settings.
Normally, a CUPS client runs on a regular workstation located in a
trusted network environment behind a firewall. In this case it is
recommended to configure the network interface to be in the
Internal Zone
, so the workstation is reachable from
within the network.
If the CUPS server is part of a trusted network environment protected
by a firewall, the network interface should be configured to be in the
Internal Zone
of the firewall. It is not recommended
to set up a CUPS server in an untrusted network environment unless you
take care that it is protected by special firewall rules and secure
settings in the CUPS configuration.
The YaST printer configuration sets up the queues for CUPS using the
PPD files installed in /usr/share/cups/model
. To
find the suitable PPD files for the printer model, YaST compares the
vendor and model determined during hardware detection with the vendors
and models in all PPD files. For this purpose, the YaST printer
configuration generates a database from the vendor and model information
extracted from the PPD files.
The configuration using only PPD files and no other information sources
has the advantage that the PPD files in
/usr/share/cups/model
can be modified freely. For
example, if you only have PostScript printers, normally you do not need
the Foomatic PPD files in the cups-drivers
package or the Gutenprint PPD files in the
gutenprint
package. Instead, the PPD files for
your PostScript printers can be copied directly to
/usr/share/cups/model
(if they do not already exist
in the manufacturer-PPDs
package) to achieve an
optimum configuration for your printers.
cups
Package¶
The generic PPD files in the cups
package have
been complemented with adapted Foomatic PPD files for PostScript level
1 and level 2 printers:
/usr/share/cups/model/Postscript-level1.ppd.gz
/usr/share/cups/model/Postscript-level2.ppd.gz
cups-drivers
Package¶
Normally, the Foomatic printer filter
foomatic-rip
is used together with Ghostscript
for non-PostScript printers. Suitable Foomatic PPD files have the
entries *NickName: ... Foomatic/Ghostscript
driver
and *cupsFilter: ...
foomatic-rip
. These PPD files are located in the
cups-drivers
package.
YaST generally prefers a manufacturer-PPD
file. However, when no suitable
manufacturer-PPD
file exists, a Foomatic PPD
file with the entry *NickName: ... Foomatic ...
(recommended)
is selected.
gutenprint
Package¶
Instead of foomatic-rip
, the CUPS filter
rastertogutenprint
from Gutenprint (formerly
known as GIMP-Print) can be used for many non-PostScript printers. This
filter and suitable Gutenprint PPD files are available in the
gutenprint
package. The Gutenprint PPD files
are located in /usr/share/cups/model/gutenprint/
and have the entries *NickName: ...
CUPS+Gutenprint
and *cupsFilter: ...
rastertogutenprint
.
manufacturer-PPDs
Package¶
The manufacturer-PPDs
package contains PPD
files from printer manufacturers that are released under a sufficiently
liberal license. PostScript printers should be configured with the
suitable PPD file of the printer manufacturer, because this file
enables the use of all functions of the PostScript printer. YaST
prefers a PPD file from the manufacturer-PPDs
.
YaST cannot use a PPD file from the
manufacturer-PPDs
package if the model name
does not match. This may happen if the
manufacturer-PPDs
package contains only one
PPD file for similar models, like Funprinter 12xx series. In this case,
select the respective PPD file manually in YaST.
The following sections cover some of the most frequently encountered printer hardware and software problems and ways to solve or circumvent these problems. Among the topics covered are GDI printers, PPD files and port configuration. Common network printer problems, defective printouts, and queue handling are also addressed.
These printers do not support any common printer language and can only be addressed with special proprietary control sequences. Therefore they can only work with the operating system versions for which the manufacturer delivers a driver. GDI is a programming interface developed by Microsoft* for graphics devices. Usually the manufacturer delivers drivers only for Windows, and since the Windows driver uses the GDI interface these printers are also called GDI printers. The actual problem is not the programming interface, but the fact that these printers can only be addressed with the proprietary printer language of the respective printer model.
Some GDI printers can be switched to operate either in GDI mode or in one of the standard printer languages. See the manual of the printer whether this is possible. Some models require special Windows software to do the switch (note that the Windows printer driver may always switch the printer back into GDI mode when printing from Windows). For other GDI printers there are extension modules for a standard printer language available.
Some manufacturers provide proprietary drivers for their printers. The disadvantage of proprietary printer drivers is that there is no guarantee that these work with the installed print system or that they are suitable for the various hardware platforms. In contrast, printers that support a standard printer language do not depend on a special print system version or a special hardware platform.
Instead of spending time trying to make a proprietary Linux driver work, it may be more cost-effective to purchase a printer which supports a standard printer language (preferably PostScript). This would solve the driver problem once and for all, eliminating the need to install and configure special driver software and obtain driver updates that may be required due to new developments in the print system.
If the manufacturer-PPDs
package does not
contain a suitable PPD file for a PostScript printer, it should be
possible to use the PPD file from the driver CD of the printer
manufacturer or download a suitable PPD file from the Web page of the
printer manufacturer.
If the PPD file is provided as a zip archive (.zip) or a self-extracting
zip archive (.exe
), unpack it with
unzip. First, review the license terms of the PPD
file. Then use the cupstestppd utility to check if
the PPD file complies with «Adobe PostScript Printer Description
File Format Specification, version 4.3.» If the utility returns
«FAIL,» the errors in the PPD files are serious and are
likely to cause major problems. The problem spots reported by
cupstestppd should be eliminated. If necessary, ask
the printer manufacturer for a suitable PPD file.
The safest approach is to connect the printer directly to the first parallel port and to select the following parallel port settings in the BIOS:
I/O address: 378
(hexadecimal)
Interrupt: irrelevant
Mode: Normal
, SPP
, or
Output Only
DMA: disabled
If the printer cannot be addressed on the parallel port despite these
settings, enter the I/O address explicitly in accordance with the
setting in the BIOS in the form 0x378
in
/etc/modprobe.conf
. If there are two parallel ports
that are set to the I/O addresses 378
and
278
(hexadecimal), enter these in the form
0x378,0x278
.
If interrupt 7
is free, it can be activated with the
entry shown in Пример 14.1, «/etc/modprobe.conf
: Interrupt Mode for the First Parallel Port».
Before activating the interrupt mode, check the file
/proc/interrupts
to see which interrupts are
already in use. Only the interrupts currently being used are displayed.
This may change depending on which hardware components are active. The
interrupt for the parallel port must not be used by any other device. If
you are not sure, use the polling mode with irq=none
.
Пример 14.1. /etc/modprobe.conf
: Interrupt Mode for the First Parallel Port¶
alias parport_lowlevel parport_pc options parport_pc io=0x378 irq=7
Connect the printer directly to the computer. For test purposes, configure the printer as a local printer. If this works, the problems are related to the network.
The TCP/IP network and name resolution must be functional.
Use the following command to test if a TCP connection can be
established to lpd (port 515
)
on host
:
netcat -z host
515 && echo ok || echo failed
If the connection to lpd cannot be established, lpd may not be active or there may be basic network problems.
As the user root
, use the
following command to query a (possibly very long) status report for
queue
on remote
host
, provided the respective
lpd is active and the host accepts queries:
echo -e "\004queue" \
| netcat -w 2 -p 722 host
515
If lpd does not respond, it may not be active or
there may be basic network problems. If lpd
responds, the response should show why printing is not possible on
the queue
on host
. If you
receive a response like that shown in Пример 14.2, «Error Message from lpd»,
the problem is caused by the remote lpd.
Пример 14.2. Error Message from lpd¶
lpd: your host does not have line printer access lpd: queue does not exist printer: spooling disabled printer: printing disabled
A CUPS network server can broadcast its queues by default every 30
seconds on UDP port 631
. Accordingly, the
following command can be used to test whether there is a broadcasting
CUPS network server in the network. Make sure to stop your local CUPS
daemon before executing the command.
netcat -u -l -p 631 & PID=$! ; sleep 40 ; kill $PID
If a broadcasting CUPS network server exists, the output appears as shown in Пример 14.3, «Broadcast from the CUPS Network Server».
The following command can be used to test if a TCP connection can be
established to cupsd (port 631
)
on host
:
netcat -z host
631 && echo ok || echo failed
If the connection to cupsd cannot be established,
cupsd may not be active or there may be basic
network problems. lpstat -h host
-l -t returns a (possibly very long) status report for all
queues on host
, provided the respective
cupsd is active and the host accepts queries.
The next command can be used to test if the
queue
on host
accepts a print job consisting of a single carriage-return character.
Nothing should be printed. Possibly, a blank page may be ejected.
echo -en "\r" \
| lp -d queue -h host
Spoolers running in a print server box sometimes cause problems when they have to deal with multiple print jobs. Since this is caused by the spooler in the print server box, there no way to resolve this issue. As a work-around, circumvent the spooler in the print server box by addressing the printer connected to the print server box directly with the TCP socket. See Раздел 14.5, «Network Printers».
In this way, the print server box is reduced to a converter between
the various forms of data transfer (TCP/IP network and local printer
connection). To use this method, you need to know the TCP port on the
print server box. If the printer is connected to the print server box
and turned on, this TCP port can usually be determined with the
nmap utility from the
nmap
package some time after the print
server box is powered up. For example, nmap
IP-address
may deliver the
following output for a print server box:
Port State Service 23/tcp open telnet 80/tcp open http 515/tcp open printer 631/tcp open cups 9100/tcp open jetdirect
This output indicates that the printer connected to the print server
box can be addressed via TCP socket on port 9100
.
By default, nmap only checks a number of commonly
known ports listed in
/usr/share/nmap/nmap-services
. To check all
possible ports, use the command nmap
-p from_port
-to_port
IP-address
.
This may take some time. For further information, refer to the man
page of nmap.
Enter a command like
echo -en "\rHello\r\f" | netcat -w 1 IP-address port cat file | netcat -w 1 IP-address port
to send character strings or files directly to the respective port to test if the printer can be addressed on this port.
For the print system, the print job is completed when the CUPS back-end completes the data transfer to the recipient (printer). If further processing on the recipient fails (for example, if the printer is not able to print the printer-specific data) the print system does not notice this. If the printer is not able to print the printer-specific data, select a PPD file that is more suitable for the printer.
If the data transfer to the recipient fails entirely after several
attempts, the CUPS back-end, such as USB
or
socket
, reports an error to the print system (to
cupsd). The back-end determines how many unsuccessful
attempts are appropriate until the data transfer is reported as
impossible. As further attempts would be in vain,
cupsd disables printing for the respective queue.
After eliminating the cause of the problem, the system administrator
must reenable printing with the command cupsenable.
If a CUPS network server broadcasts its queues to the client hosts via browsing and a suitable local cupsd is active on the client hosts, the client cupsd accepts print jobs from applications and forwards them to the cupsd on the server. When cupsd on the server accepts a print job, it is assigned a new job number. Therefore, the job number on the client host is different from the job number on the server. As a print job is usually forwarded immediately, it cannot be deleted with the job number on the client host This is because the client cupsd regards the print job as completed as soon as it has been forwarded to the server cupsd.
When it becomes desirable to delete the print job on the server, use a command such as lpstat -h cups.example.com -o to determine the job number on the server, provided the server has not already completed the print job (that is, sent it completely to the printer). Using this job number, the print job on the server can be deleted:
cancel -h cups.example.com queue-jobnumber
If you switch the printer off or shut down the computer during the printing process, print jobs remain in the queue. Printing resumes when the computer (or the printer) is switched back on. Defective print jobs must be removed from the queue with cancel.
If a print job is defective or an error occurs in the communication between the host and the printer, the printer prints numerous sheets of paper with unintelligible characters, because it is unable to process the data correctly. To rectify this situation, follow these steps:
To stop printing, remove all paper from ink jet printers or open the paper trays of laser printers. High-quality printers have a button for canceling the current printout.
The print job may still be in the queue, because jobs are only removed
after they are sent completely to the printer. Use lpstat
-o or lpstat -h cups.example.com -o to check
which queue is currently printing. Delete the print job with
cancel
queue
-jobnumber
or cancel -h cups.example.com
queue
-jobnumber
.
Some data may still be transferred to the printer even though the print job has been deleted from the queue. Check if a CUPS back-end process is still running for the respective queue and terminate it. For example, for a printer connected to the parallel port, the command fuser -k /dev/lp0 can be used to terminate all processes that are still accessing the printer (more precisely: the parallel port).
Reset the printer completely by switching it off for some time. Then insert the paper and turn on the printer.
Use the following generic procedure to locate problems in the CUPS print system:
Set LogLevel debug in
/etc/cups/cupsd.conf
.
Stop cupsd.
Remove /var/log/cups/error_log*
to avoid having
to search through very large log files.
Start cupsd.
Repeat the action that led to the problem.
Check the messages in /var/log/cups/error_log*
to
identify the cause of the problem.
Solutions to many specific problems are presented in the SUSE Support
Database
(http://en.opensuse.org/Portal:Support_database). Locate
the relevant articles with a text search for
SDB:CUPS
.