Installing CUPS on the Solaris 9 Operating SystemAlejandro Piro, January, 2005 The Common UNIX Printing System (CUPS) is an open-source tool that, when installed, causes a box running the Solaris OS to act like a print server, managing all print queues on a network. CUPS supports several printing protocols, including the Line Printer Daemon ( Printers may be located on the network or connected locally to serial ports, a parallel port, or universal serial bus (USB) ports. You can download and update printers and drivers from a web site. A system administrator creates, manages, and modifies printers and queues using a web-based graphical user interface (GUI). In addition, commands are available to execute in the command-line interface (CLI). Installing CUPSYou don't need to compile anything because you can access the Solaris package in one of two ways, listed below. (Both methods install the files -- including commands, binaries, logs, and so on -- into subdirectories under application/networking section, select the two components cups and cupsprint.
Download it from sunfreeware:
ftp://ftp.sunfreeware.com/pub/freeware/companioncd/sparc/9
The file name for # unzip cups-1.1.14-pkg.zip # pkgadd -d SFWcups These packages are installed: system SFWcprnt cupsprint - CUPS Print Suite Cluster system SFWcups cups - Common UNIX Printing System The Printing SystemCUPS is a complete printing system; therefore, make sure that the Solaris printing system and CUPS are not running at the same time. Stop the # /etc/init.d/lp.stop # mv /etc/rc2.d/S801p /etc/rc2.d/s801p Printing CommandsBefore you configure the software, make a backup of the Solaris printing commands and link to the CUPS commands, as shown here. The first column includes the Solaris commands, and the second column shows what those commands link to: /usr/bin/lp /opt/sfw/cups/bin/lp /usr/bin/lpstat /opt/sfw/cups/bin/lpstat /usr/bin/cancel /opt/sfw/cups/bin/cancel /usr/bin/enable /opt/sfw/cups/bin/enable /usr/sbin/lpadmin /opt/sfw/cups/sbin/lpadmin /usr/sbin/lpmove /opt/sfw/cups/sbin/lpmove /usr/sbin/accept /opt/sfw/cups/sbin/accept For example, you might do something like the following to replace the # mv /usr/bin/lp /usr/bin/lp.solaris # ln -s /opt/sfw/cups/bin/lp /usr/bin/lp Repeat the replacement commands for each command listed above. To use the CUPS printer admin commands, include the following subdirectories in your path: /opt/sfw/cups/bin:/opt/sfw/cups/sbin Configuring CUPSThe main configuration file for CUPS is: # PrintcapFormat: the format of the printcap file, currently either # BSD or Solaris. The default is "BSD". # # PrintcapFormat BSD PrintcapFormat Solaris Starting CUPSCopy the start/stop script and make links to run levels 2 and 1, ensuring that CUPS starts on the next reboot: # cp /opt/sfw/cups/etc/init.d/cups /etc/init.d # ln -s /etc/init.d/cups /etc/rc2.d/S99cups # ln -s /etc/init.d/cups /etc/rc1.d/K99cups To start the CUPS scheduler, type: # etc/init.d/cups start Creating New Printers
Now that CUPS is running, you are able to configure, add, or modify printers using two methods: command line and web interface. Each print queue has a name and a device associated with it. The devices use the Uniform Resources Identifiers (URI) form. For example, the serial port "a" uses a device URI of To see a list of supported devices, you can run the following command: # lpinfo -v The first word in each line is the type of device (direct, file, network, serial), followed by the device URI. Finally, printer queues usually have an associated PostScript Printer Description (PPD) file. These files are used for PostScript and non-PostScript printers. CUPS includes PPD files for HP LaserJet, HP DeskJet, Epson, and so on.
To add a printer from the command line, you can use the lpadmin -p printer -E -v device -m ppd
Here
For example, you would use this for a networked HP LaserJet printer using a JetDirect network interface at IP address # lpadmin -p Laserjet -E -v socket://11.22.33.44 -m laserjet.ppd
To check, use the # lpstat -v To configure, add, or modify printers via the GUI, use a web browser and open the URL:
Select the Do Administration Tasks option. In the web interface, CUPS provides a user-friendly "wizard" to add a printer. Follow the steps after you click on the Add Printer button.
To test the printer, use the # lp -d printer filename Or you can select Manage Printers, Print Test Page from the web interface. TroubleshootingTo find out what's going wrong, first you should increase the log level.
To increase the log level, edit the configuration file # # LogLevel: controls the number of messages logged to the ErrorLog # file and can be one of the following: # # debug2 Log everything. # debug Log almost everything. # info Log all requests and state changes. # warn Log errors and warnings. # error Log only errors. # none Log nothing. # LogLevel debug
Then restart the scheduler and look at the files ReferencesLinuxPrinting.org web site (for driver and printer information) About the AuthorAlejandro Piro is a Sun Certified System Administrator for Solaris. Currently he is working in a company as system administrator of Solaris systems.
The information and links on this page have been provided by a BigAdmin user. The submitter is solely responsible for such information and links. Sun is not responsible for the availability of external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. Sun will not be responsible or liable, directly or indirectly, for any actual or alleged damage or loss caused by or in connection with use of or reliance on the information posted here, or goods or services available on or through any external site or resource. Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
| |||