CUPS and Sun
I recently spent some time getting one of my long term projects built. For quite some time I've had an old desktop computer serve as my printer server. As this machine is kind of loud, I've turned it off when not using it. This led to some client machines not appreciating the printer becoming available at the wrong time.
In my posession I also had an old mini-itx board with passive cooling (large heat sinks) and a pair of sun portable scsi hdd cases. Incidentally, the latter fit into the former. The plan for a new print server was born.
The build itself turned out to be pretty straightforward. A 8GB CF-card serves as harddrive and an 80W pico-PSU was used to move the AC-DC conversion outside the box to a power brick delivering 12V DC. The resulting system is dead silent and does not use much power.
On the software side I installed debian. This was for two reasons: the debian netinst images helps installing a compact system without having to download gigabytes, and debain comes with a kernel that plays nice with my old Via C3 processor (which lacks the optional i586 cmov instruction).
Having run the installer and installed a minimal system, time came to install the printer server functionality. This is easier than you might think, simply apt-get install the cups package. I installed some of the recommended packages as well, but basically cups will do it.
Having installed cups, you need to tweak the /etc/cups/cupsd.conf to make cups available to the rest of the world. The Listen localhost:631 line can be changed to Listen 631. BrowseAllow should allow all. Also, the Location / tag needs the line Allow all. After these changes, simply restart cups using /etc/init.d/cups restart. Now you should be able to reach your new machine as ip.of.the.machine:631.
The cool kids now open localhost:631, pick admin, log on and add the printer. However, here, the coolest browser is Lynx and I don't feel lika configuring printers using Lynx. Instead, I do it over the command line. How do you do this? Basically, it takes three steps. First, use lpinfo to locate your printer(s). You might want to run this as root, as it is located in the /usr/sbin directory.
# lpinfo -v network socket network beh direct usb://HP/color%20LaserJet%202550%20series network http network ipp network lpd direct parallel:/dev/lp0 direct scsi serial serial:/dev/ttyS0?baud=115200 network smb
As you can see, a whole range of options are listed, but one item is the printer in question - in this case my old trusty HP2550. The lpadmin command is then used to add the printer to the system. In the line below, it is added with the name hp2550, -v specifies the printer in question and -P picks out a ppd file (i.e. a printer configuration).
# lpadmin -E -p hp2550 -v "usb://HP/color%20LaserJet%202550%20series" -P /usr/share/ppd/cups-included/HP/laserjet.ppd
The -E option is important as it enables the printer in cups and starts accepting jobs for it. You can do this afterwards using the following commands if you'd like to.
# cupsenable hp2550 # accept hp2550
Another tweak that is good to know is how to set the default printer.
# lpadmin -d hp2550
For some reason the laserjet.ppd did not really cut it for my needs. For instance, the results came out as black and white. Using the printer database over at http://www.openprinting.org/printers, I was able to retreive a new ppd for my printer. Then I simply replaced the ppd in the /etc/cups/ppd directory and I had color printing. For the fine tuning, the lpoptions command is handy. For instance, changing the paper size to A4 as as simple as this. Just entering lpoptions without any arguments prints out a list of settings for each printers. From this list, you can figure out which options to tune.
# lpoptions -p hp2550 -o media=A4
Now I can add the printer as a PostScript printer is both Linux and Windows and it Just Works. With my new print server hardware it will always be on and the box looks so pretty in my geeky eyes. FYI, I do power off the printer when it is not used, but the server simply queues jobs.
Johan Thelin is a consultant working with Qt, embedded and free
software. On-line, he is known as e8johan.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Profiles and RC Files
- Maru OS Brings Debian to Your Phone
- Understanding Ceph and Its Place in the Market
- Astronomy for KDE
- OpenSwitch Finds a New Home
- Git 2.9 Released
- SoftMaker FreeOffice
- Snappy Moves to New Platforms
- What's Our Next Fight?
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide