Você está na página 1de 10

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.

com)

Printer Setup in Linux


Step 1: Turn on the printer Stop laughing. Be sure it's plugged in, connected to the appropriate parallel port, and is turned on and online. Step 2: Install the Printer Package First we need to install the software needed to manage printer services. To see if the software is installed on our computer, type: rpm -qa | grep lpr If we see the lpr package show up, the software is installed. If not, we should download and install it. To install the package once we ftp it, type (as root): rpm -Uvh lpr-0.50-4.i386.rpm Step 3: Configure the Printer Service As root, open printtool. If we're logged in as an ordinary user and don't want to log out, just type xhost +localhost, then su (i.e. switch user to root), type in the root password, then type printtool. The printer configuration tool will pop up, and if we've not yet configured a printer, it will be blank.

Now click on ADD. We will then see:

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Select "local printer" as shown above. Linux will then attempt to detect our printer. Soral here has found a printer on the first parallel port. Goody!

Now click OK and we will see the following dialog box:

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

If the defaults look OK (I usually use the name "lp" instead of "lp0" above), click on "SELECT" and pick our printer type and the resolution:

If our printer is a Postscript printer, select that option as shown above. Select our best printer resolution; I've chosen 600x600 as is the default for Steward printers like lw1 or lw5 or lw26. Hit OK when done.

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Above is the final display screen for a fully configured printer. Restarting the Printer Services We can use the lpd menu to restart the printer daemon and use the TESTS menu to print a test Postscript page. Alternatively, go over to /etc/rc.d/init.d/ and type ./lpd stop and then ./lpd start. Then try to print something.

Managing Print Jobs


When we send a print job to the printer daemon, such as printing text file from Emacs or printing an image from The GIMP, the print job is added to the print spool queue. The print spool queue is a list of print jobs that have been sent to the printer and information about each print request, such as the status of the request, the username of the person who sent the request, the hostname of the system that sent the request, the job number, and more. If we are running a graphical desktop environment, click the Printer Manager icon on the panel to start the GNOME Print Manager as shown in fig 7

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Figure7. GNOME Print Manager It can also be started by selecting Main Menu Button (on the Panel) => System Tools => Print Manager. To change the printer settings, right-click on the icon for the printer and select Properties. The Printer Configuration Tool is then started. Double-click on a configured printer to view the print spool queue as shown in fig 8

Figure 8. List of Print Jobs To cancel a specific print job listed in the GNOME Print Manager, select it from the list and select Edit => Cancel Documents from the pulldown menu. If there are active print jobs in the print spool, a printer notification icon might appears in the Panel Notification Area of the desktop panel as shown in fig 9. Because it probes for active print jobs every five seconds, the icon might not be displayed for short print jobs.

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Figure 9. Printer Notification Icon Clicking on the printer notification icon starts the GNOME Print Manager to display a list of current print jobs. Also located on the Panel is a Print Manager icon. To print a file from Nautilus, browse to the location of the file and drag and drop it on to the Print Manager icon on the Panel. The window shown in Figure 10 is displayed. Click OK to start printing the file.

Figure 10. Print Verification Window To view the list of print jobs in the print spool from a shell prompt, type the command lpq. The last few lines will look similar to the following:

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Rank Owner/ID Time active user@localhost+902 01:20:46

Class A

Job Files 902 sample.txt

Size 2050

Sharing a Printer The Printer Configuration Tool's ability to share configuration options can only be used if we are using the CUPS printing system. Allowing users on a different computer on the network to print to a printer configured for our system is called sharing the printer. By default, printers configured with the Printer Configuration Tool are not shared. To share a configured printer, start the Printer Configuration Tool and select a printer from the list. Then select Action => Sharing from the pulldown menu. Note: If a printer is not selected, Action => Sharing only shows the system-wide sharing options normally shown under the General tab. On the Queue tab, select the option to make the queue available to other users.

Figure 11. Queue Options After selecting to share the queue, by default, all hosts are allowed to print to the shared printer. Allowing all systems on the network to print to the queue can be dangerous,
Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

especially if the system is directly connected to the Internet. It is recommended that this option be changed by selecting the All hosts entry and clicking the Edit button to display the window shown in Figure 11. If we have a firewall configured on the print server, it must be able to send and receive connections on the incoming UDP port, 631. If we have a firewall configured on the client (the computer sending the print request), it must be allowed to send and accept connections on port 631.

Figure 12. Allowed Hosts The General tab configures settings for all printers, including those not viewable with the Printer Configuration Tool. There are two options:

Figure 13. System-wide Sharing Options


Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Automatically find remote shared queues Selected by default, this option enables IPP browsing, which means that when other machines on the network broadcast the queues that they have, the queues are automatically added to the list of printers available to the system; no additional configuration is required for a printer found from IPP browsing. This option does not automatically share the printers configured on the local system. Enable LPD protocol This option allows the printer to receive print jobs from clients configured to use the LPD protocol using the cups-lpd service, which is an xinetd service.

Warning If this option is enabled, all print jobs are accepted from all hosts if they are received from an LPD client Sharing a Printer with LPRng If we are running the LPRng printing system, sharing must be configured manually. To allow systems on the network to print to a configured printer on a Red Hat Linux system, use the following steps: 1. Create the file /etc/accepthost. In this file, add the IP address or hostname of the system that we want to allow print access to, with one line per IP or hostname. 2. Uncomment the following line in /etc/lpd.perms: ACCEPT SERVICE=X REMOTEHOST=</etc/accepthost 3. Restart the daemon for the changes to take effect: service lpd restart

Switching Print Systems


To switch printing systems, run the Printer System Switcher application. Start it by selecting the Main Menu Button (on the Panel) => System Settings => More System Settings => Printer System Switcher, or type the command redhat-switch-printer at a shell prompt (for example, in an XTerm or GNOME terminal). The program automatically detects if the X Window System is running. If it is running, the program starts in graphical mode as shown in Fig 14. If X is not detected, it starts in a text-based mode. To force it to run in as a text-based application, use the command redhat-switch-printer-nox.
Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Figure 14. Printer System Switcher Select either the LPRng or the CUPS printing system. In Red Hat Linux 9, CUPS is the default. If we only have one printing system installed, it is the only option shown. If we select OK to change the printing system, the selected print daemon is enabled to start at boot time, and the unselected print daemon is disabled so that it does not start at boot time. The selected print daemon is started, and the other print daemon is stopped; thus making the changes take place immediately.

Useful Websites

http://www.linuxprinting.org GNU/Linux Printing contains a large amount of information about printing in Linux. http://www.cups.org/ Documentation, FAQs, and newsgroups about CUPS.

Semaphore Technologies Pvt. Ltd. (technologies.semaphore@gmail.com)

Você também pode gostar