Locating CUPS print hosts on the network

Aug 31, '02 07:18:19AM

Contributed by: Anonymous

CUPS printing works fine out of the box for most people, but there are a few exceptions. The biggest problem is that many people can't seem to find networked CUPS print servers. I found, in my case, this was because CUPS was not being told where to look for one.

There is a file in /etc/cups called client.conf which needs to be edited. This is most easily done with pico (a Terminal text editor), but as the file is also owned by root, you need to be an administrator. Open the terminal program and move to the cups directory by typing cd /etc/cups then type sudo pico client.conf to start editing the file. If you want to, you could make a backup first by typing something like sudo client.conf client.backup.conf. The first time you use sudo you will get a warning about being careful and, whenever you use sudo after a long period as a 'normal' user, you need to enter your password.

In pico, find the line starting with #ServerName and on the next line, type ServerName Name_of_print_host (don't use quotes or anything; just type the name of the host). Notice the lack of a # sign at the start of the line. There shouldn't be one - that's important. Press control-x to exit pico and save (say yes, you do want to save the file). That's the change made.

Now, for the changes to take effect, you need to restart the cupsd deamon. If you don't like doing this soft of command line stuff, just restart the machine. If you don't want to restart, the following line will usually do it (it finds the pid of the cupsd deamon and sends it a restart command). This all needs to go on one line so it might be better not to copy and paste. Also notice the single quote marks near the start and right at the end are the ones on (on my Apple keyboard) the left under the ~, not the one under the double quote:

sudo kill -HUP `ps -Uroot | grep -n "cupsd" | awk '{print $2}'`
When you next run Print Center, all the printers from the print host should appear.

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20020831071819662