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"
- ServersCheck's Thermal Imaging Camera Sensor
- The Italian Army Switches to LibreOffice
- Petros Koutoupis' RapidDisk
- Linux Mint 18
- Oracle vs. Google: Round 2
- The FBI and the Mozilla Foundation Lock Horns over Known Security Hole
- Ben Rady's Serverless Single Page Apps (The Pragmatic Programmers)
- Privacy and the New Math
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide