Using CUPS Print Server for Solaris 10

Life is too short for bad printer software

Screen shot of CUPS configuration menu at http://localhost:631/printers/ Ever used lpadmin? It's a big pain—command line oriented with little error checking. It's hard to use and has many options to get you into trouble. That's why I prefer CUPS, Common UNIX Printing System, which is used mostly on Linux and has web-based menus. The CUPS menus only present relevant options and have extensive error checking.

The tutorial below shows how to use CUPS to access one network printer from Solaris 10. The network printer I use happens to be a IOGEAR USB Print Server attached to my local home network and a EPSON STYLUS COLOR C86 printer. This print server works with the LPD protocol (for Linux/Solaris) and MS Windows printing protocols.

Installing CUPS is available from the "Software Companion" CD (along with all the other SFW\* open-source packages). You want package SFWcups, and probably SFWcprnt, which also bundles packages SFWespgs, SFWhpijs, SFWxpp, SFWgprnt). Pre-compiled CUPS packages are available elsewhere, such as sunfreeware.com

Disabling Solaris lp\* commands (optional) To avoid confusion, I recommend disabling Solaris lp\* commands. Applications typically use /usr/bin/lp to print and it's easy to forget to reconfigure. I recommend renaming the old commands and linking to the CUPS commands. Here's a sample shell script to do this:

#! /bin/sh
cd /usr/bin
for i in lp lpstat cancel enable ; do
   mv $i $i.old
   ln -s /opt/sfw/cups/bin/$i .
done
cd /usr/sbin
for i in lpadmin lpmove accept ; do
   mv $i $i.old
   ln -s /opt/sfw/cups/sbin/$i .
done

Enabling CUPS Add /opt/sfw/cups/bin to the PATH of each user, in front of /usr/bin. Also add /opt/sfw/cups/sbin to the PATH of each print administrator, in front of /usr/sbin. Enable the CUPS daemon, cupsd, with this shell script:

#! /bin/sh
cp /opt/sfw/cups/etc/init.d/cups /etc/init.d
for i in rc0.d rc1.d rcS.d ; do
   ln /etc/init.d/cups /etc/$i/K00cups
done
for i in rc2.d rc3.d ; do
   ln /etc/init.d/cups /etc/$i/S99cups
done
/etc/init.d/cups start
/etc/init.d/cups status
Next, set the CUPS root password (saved in file /opt/sfw/cups/etc/cups/passwd.md5). This password may be the same or different from your UNIX root password. Set it with this command:
/opt/sfw/cups/bin/lppasswd -g sys -a root
No modification of the cups.conf file is required, the file is at/opt/sfw/cups/etc/cups/cupd.conf The cups.conf file is extensively documented in the CUPS Software Administrators Manual (SAM)

Initial CUPS setup To setup your first printer with CUPS, after starting cupsd agove, go to http://localhost:631/ Beware that if you access this URL remotely, transactions, including CUPS passwords, can be viewed over the network. This is why remote access disabled by default in cupsd.conf. Here's the steps I took to enable my network printer on server "adams" (defined in /etc/hosts) with network print queue "lp1":

  • Click "Do Administrative Tasks" and enter your CUPS account (root) and CUPS root password
  • Click "Add Printer"
  • Fill in the form. For sanity reasons, I use the same name for the local queue as for the remote network queue (lp1):
    • Name: lp1
    • Location: In office
    • Description: Epson Stylus C86
  • Device: I selected "LPD/LPR host or printer"
  • Device URI. I used "lpd://adams/lp1" (without the quotes). Here's some other examples:
    • file:/path/to/filename.prn
    • http:/hostname:6531/ipp/
    • http:/hostname:6531/ipp/port1
    • lpd://hostname/queue
    • socket://hostname
    • socket://hostname:9100
    For more detail, see the SAM
  • Model. I used "EPSON"
  • Model/Driver for lp1. Select the model closest to your printer. Try different drivers if one doesn't work. The menu just uses PPD drivers in /opt/sfw/cups/share/cups/model/\*ppd. Solaris \*.ppd drivers are in /usr/lib/lp/model/ppd/\*.ppd (package SUNWfppd). See also if your printer manufacturer has a \*.ppd printer driver file for their printer on their web site. I selected "Epson Stylus COLOR C84-CUPS+Gimp-Print", as C84 is the closest to my C86.
  • It should now say "Printer added successfully." Click on the printer link and click "set as default"
  • Verify the printer works by clicking "Print test page"
  • Try printing also from your favorite app, such as Firefox, StarOffice, or OpenOffice.

Printer defaults The above steps sets the default printer. You may want to make sure the default is not easily overridden by setting the PRINTER and LPDEST environmental variables and setting up a $HOME/.printers file looking something like this:

_default lp1
_all lp1
This step is the same for Solaris whether or not you use CUPS.

Removing old print server software (optional). To reduce errors and confusion, I removed the old printer software. You may want to wait until you're sure you want to use CUPS and not go back to the default Solaris printing tools and server. The packages can always be re-added from the install DVD. The softare package removal may be done with this script. Answer "y" to the prompts when running:

#! /bin/sh
for i in server cleanup rfc1179 ; do
    svcadm disable print/$i
done
pkgrm SUNWscplp SUNWppm SUNWpsu SUNWpsr SUNWpcu SUNWpcr 
This disables the old print services and removes these packages:
  • SUNWpsr Solaris Print - LP Server, (root)
  • SUNWpsu Solaris Print - LP Server, (usr)
  • SUNWpcr Solaris Print - Client, (root)
  • SUNWpcu Solaris Print - Client, (usr)
  • SUNWscplp Solaris Print - Source Compatibility, (Usr)
  • SUNWppm Solaris Print Manager
You need to recreate links from /opt/sfw/cups/bin/lp to /usr/bin/lp, etc., if desired, as shown above.

Update 12/2008: CUPS has been removed from the S10 10/08 (U6) Companion CD, due to legal restritions on the Berkeley DB package. It is available in OpenSolaris as package SUNWcups and for S10 you may be able to use the SFWcups from an earlier version of the Companion CD, or download from blastwave.org Blastwave, or download source from CUPS

References

Comments:

I setup a cups print server (on Linux) and am pointing the Sun desktop's (not running cups) to the cups server. It works great for almost everything I've try except the sun desktop's are not pushing the options to the cups server. For example on Linux cups to print on 11x17 paper lp -o media=Tabloid -dMy_Printer My_Job On Solaris lp -o 11x17 -dMy_Printer My_Job I first tryed changing my options, but that didn't work. Then I turned the debug level up on the cups server and no mater what I put on the command line from Sun it option string is alway default. Any idea what I should do next?

Posted by John on December 09, 2006 at 10:03 AM PST #

Sorry--don't know the answer to that one. The configuration shouldn't be any different for Solaris to remote Linux as Linux to remote Linux. I would ask around on some CUPS web logs.

Posted by Dan Anderson on December 15, 2006 at 04:01 PM PST #

Dan, this tutorial was really helpful. Now if only Oracle could get ther act together and let me specify the IPP destination on the fly in the Bursting Engine...

Posted by TyskJohan on December 19, 2006 at 05:52 PM PST #

Did you try this with Solaris 10 11/06? Looks like the cupsd is broken in this rev.

Posted by Keith Ketchmark on January 02, 2007 at 05:55 AM PST #

Keith, I tried Solaris 10 06/06. After upgrading to Solaris 10 11/06 CUPS printing still works. What specifically is the problem you're having with cupsd?

Posted by Dan Anderson on January 19, 2007 at 05:18 AM PST #

hello, i'm using cups 1.2.7 on solaris 10 11/06, everything works fine, except that a banner is always printed, whatever i modify. I notice that it happens only from Sun lp/lpr, not cups lp/lpr. This trouble never happen in cups 1.1.x, but in cups 1.1.x, many documents can't be printed. What is the point in Sun lp which tell cups to always print banner? thanks

Posted by gerard on January 31, 2007 at 03:39 PM PST #

gerard, Go to http://localhost:631/ (CUPS) and click on "Configure Printer". "Starting Banner" and "Ending Banner" should be "none". I use cups lp/lpr, not Sun lp/lpr. For suppressing the Sun lp/lpr banner, see my FAQ: http://sun.drydog.com/faq/6.html#6.3

Posted by Dan Anderson on February 02, 2007 at 03:28 AM PST #

Dan, If you're using cups-lpd you'll need to add "-o job-sheets=none" to its invocation as cupsd ignores the banner options specified in the normal way. Otherwise you'll still see the CUPS banner. You can also add "-h" to /usr/ucb/lpr invocations to suppress on a per-job basis.

Keith, is native (non-CUPS) IPP client-side printing available in Solaris 10? I see reports that it is available in Solaris Express, but not 10. If not, are there plans for it to be in Solaris 10?

Posted by Ryan Lovett on February 15, 2007 at 01:55 AM PST #

Err, Dan: what I said to Keith, and Keith: what I said to Dan. :)

Posted by Ryan Lovett on February 15, 2007 at 03:26 AM PST #

Ryan, Native server-side IPP is already in Solaris 10. Native client-side IPP is in only in Nevada and Solaris Express. It's also in CUPS, of course. Sorry, I don't know about backporting plans, if any, and can't tell you if I did know. Here's some public links:
OpenSolaris Printing Community
Solaris IPP BigAdmin article

Posted by Dan Anderson on February 20, 2007 at 07:29 AM PST #

Dirk Wriedt adds this note about accessing the CUPS packages formerly in the Solaris companion CD:

"There is a new project at sunfreeware.com, where the cups package may be downloaded individually, without obtaining the whole DVD. The U4 companion packages are there, too."
http://sunfreeware.com/companioncd.html

Posted by Daniel Anderson on September 30, 2009 at 08:21 AM PDT #

I've configured CUPS on solaris 10 server.I need to configure the clients which use the CUPS server to print. My question is

1) What are the steps to configure a client.
2) Do client also needs the CUPS pakages installed?

Posted by Xtreams on October 20, 2009 at 06:05 AM PDT #

Xtreams,
Please read this blog article for CUPS client configuration. This blog does not describe CUPS server configuration details. Further CUPS documentation is listed under "references" above.

Posted by guest on October 21, 2009 at 04:06 AM PDT #

If I remove the Solaris printing packages or do not use them to set up the printer queues, how can I set or allow a per-user default printer?
We were using solaris printmgr tool previously, but this is broken in 5/08 and gnome-printinfo which let users select their default printer does not seem to work

Posted by Andrew Lea on March 01, 2010 at 01:04 PM PST #

How can I migrate or move my printer setup from old printer setup to CUPS?

Posted by Ging on June 02, 2010 at 10:22 PM PDT #

I had to change the cups port for example to 8631. It works great to get to the Admin and setup printers and Test print but for some reason the lp commands come up with lpstat: Unable to connect to server: Connection refused. I have on Solaris 10 x86.

Posted by Damon Hughes on August 13, 2010 at 02:30 AM PDT #

I have compiled cups-1.4.3 on SunOS 5.9 and it works great. But I cant find any recent binary package for installation on customer servers. Any hints? Thanks in advance, Matthias

Posted by Matthias Apitz on October 07, 2010 at 04:55 PM PDT #

I am in the process of moving over to CUPS on a V490 Solaris 10, with close on 50+ printers configured. I have looked high and low for an answer to whether there's a way to "migrate/move the /etc/printers.conf over to the CUPS printer.conf". If anybody has any idea... I'd really appreciate it.

Posted by monzbofh on November 17, 2010 at 05:56 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Solaris cryptography and optimization.

Search

Archives
« June 2015
SunMonTueWedThuFriSat
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today