Another Linux installation experience

Article Index

The next thing I addressed was printing. I already have an HP “3-in-1” printer attached to my principal Linux computer, and it's set up so I can print on it from a Windows computer that's part of the local area network that I just increased by 50%.

All of the current distributions that I'm familiar with install “cups” to handle printers. Cups is an excellent piece of software, but it is, in my opinion, inappropriate for most home users, and especially home users trying to cram as much functionality as possible into 128 MB of memory. The problem is, cups devotes a lot of resources to automatic detection and configuration of printers, and it does this as long as the computer is turned on. How often do you buy and install a new printer? If the answer is, “every five years or so”, it's better to configure the printer just once.

The alternative to cups is “LPRng”, and if you were using some form of Unix 10-15 years ago, you're probably familiar with the concept; you define the printers with the /etc/printcap file.

LPRng is no longer included with RedHat Enterprise distributions. So, I went to, downloaded it, unzipped it, and typed in “make install”.

The next thing I did was to add an entry to /etc/printcap for my networked printer. It looked something like this:


Pretty simple, right? This just says that if you make an attempt to print on the device “lp”, it will be routed to a printer named “devps” on a machine named “crow”.

The problem is, this didn't work. I got a “permission” error, and I never figured out what the problem was. Since I don't have problems accessing the same printer from the Windows machine, I looked into how this was happening, and I learned the the Windows machine was accessing it through Samba. So, I changed the /etc/printcap entry to look like this:


What this does is, when you attempt to print to “lp”, it gets processed by the /usr/bin/smbprint script. This script, in turn, expects to find a file named .config in the /var/spool/directory, and this is where you define the printer, and your samba user name and password.

This didn't work on the first try. In the smbprint script, the code that does the actual work looked like this:

cat | /usr/bin/smbclient "$share" "$password" -E ${hostip:+-I} \
$hostip -N -P $usercmd "$user" $workgroupcmd "$workgroup" \
-c "$command" 2>/dev/null

This may have worked with an earlier version of Samba, but it doesn't work with the version that comes with RedHat Enterprise Version 4. To get this working, I had to change to to this:

cat | /usr/bin/smbclient "$share" -E ${hostip:+-I} \
$hostip -N $usercmd "$user%$password" $workgroupcmd "$workgroup" \
-c "$command" 2>/dev/null

This is a problem that the RedHat people should fix.


0 #7 Guest 2006-06-16 07:01
Rather then manually setting DISPLAY to run X over your lan and having to deal with the cumbersome task of bypassing the X security features, e.g. using "xhost +" and enabling TCP connections, you could've used the SSH built-in ability to tunnel X connections.
All you'd need to do in that case is enable X tunneling on the SSH server by adding "X11Forwarding yes" to your sshd_config file, and then start SSH sessions from the client with the "-X" parameter.
SSH will do the rest, it will setup the DISPLAY and proper X secrity for you so you can avoid the insecure "xhost +".
0 #6 Theodore Kilgore 2006-06-16 03:32
First, let me say that I approve very much the idea of setting up the printer by hand. I use Slackware and I still use lpd in spite of the fact that it has recently been dropped from the distro. The following comments are based upon the successful setting up of a printer hooked to a machine on my home network. There are two possible problems that I see in what you did.

You said:


"Pretty simple, right? This just says that if you make an attempt to print on
the device lp, it will be routed to a printer named devps on a machine named

Are you sure that the printer on crow is actually called this? If the line
in crow's /etc/printcap says this is the name of the printer, then good.

"The problem is, this didn't work. I got a permission error, and I never
figured out what the problem was."

Perhaps you did not also set the option


in /etc/lpd.conf

and if you did not do this, then lpd is looking for an attached printer and
refusing to print over the network, no matter what you put in /etc/printcap.

Unfortunately this is only in recent versions of lpd, so anyone who did not
use lpd in the past couple of years probably does not know this. This config
file simply did not previously exist.

Hope this helps.
0 #5 Guest 2006-06-16 03:31
RHEL4 (or CentOS 4) is fine as an operating system. Especially for somewhat older systems where hardware support is guaranteed.

The advantage of an enterprise operating systems is that you can run it for 8 years from GA with security updates without needing to upgrade your system.

Even if upgrading takes half a day, why would you want to spend half a day to upgrade one system every 6 months to get basicly the same functionality.

Fedora is nice and you'll have the latest stuff, but often 'having the latest stuff' is not the most important. For desktops it might be, for servers it never is.

When RHEL5 is released later this year, it will be newer than FC5, will be 'more ready' for the desktop and will have again 8 years of security fixes. We can only hope the Gnome libraries are stabilised by then so we can recompile Gnome programs released in 2008 on RHEL5 without requiring to upgrade Gnome to the latest release.
0 #4 Alex 2006-06-16 03:30
I see that you are well versed in the way's of 'nix, but why choose rhe4 for the laptop? You'd have a much easier time with a distro like ubuntu, mandriva, or mepis. The 128Mb of ram would be an issue for any of the large desktops, so damn small linux or puppy may have been better due to their modest system requirements.
0 #3 Guest 2006-06-15 22:09
So you were concerned about memory footprint, but use OpenOffice and Firefox?

If you actually ran the KDE desktop with Konqueror and KOffice (1.5.1 is quite good) you'd probably find it much lighter overall since they all share the same libraries and are generally lighter than their "stand-alone" counterparts.

I've run KDE in this configuration comfortable in as little as 96MB of RAM (uncomfortably in less, but that's no fund) on systems as slow as 500Mhz.

Of course, Red Hat's KDE (and most other of their desktop packages) aren't the swiftest, so perhaps that has coloured your perceptions somewhat.
0 #2 Guest 2006-06-15 15:08
RHv4 is quite a bit behind Fedora Core 5, especially at supporting laptops since RH4 is really for servers and big iron machines.
0 #1 Guest 2006-06-15 13:23
I have a similar laptop but a little slower with the same amount of Ram. I am thinking of putting Xubuntu on it.

Add comment

Security code