an update for os x 10.4 jaguar

OS X 10.4 makes lpr/lpd sharing much easier. Turn on Printer Sharing in Sharing in the System Preferences. Then go to Print & Fax in System Preferences, and check the "Share these printers with other computers:" option and check the printers you wish to share via lpd/lpr (port 515) and OS X will do the rest and you can ignore the rest of this page.

reference apple help document: http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh1773.html


Summary of OS9 lpr setup

On the OS X 10.4 machine, go to System Preferences > Print & Fax and in the "Printing" tab, click on the printer you want to use to print from the OS9 Machine. On the right will be some descriptive information including the Name, Location, Kind and Status. Write down the "Name" of the printer, this is the name of the Queue which you'll need on the laptop (like for mine it's the "LaserJet 4L"). Also note the IP address (in TCP/IP section of Network tab in System Preferences might be something like 192.168.1.57).

Go to the OS9 Machine and find the "Desktop Printer Utility" which might be in Applications (Mac OS 9) > Utilities and open it.
You should get a window entitled "New Desktop Printer" and a popup menu "With" which should be set to "LaserWriter 8" under which you should see the "Create Desktop..." options, of which you should choose "Printer (LPR)" then hit OK

You should get a window entitled Untitled 1 with a PostScript Printer Description box and a button to "Change...", but if it's set to "Generic" that should be alright and you don't need to change it.
Under that should be a box labelled "LPR Printer Selection" and another "Change..." button. Click that "Change..." button.
In the Printer Address: box put the IP address from the OS X 10.4 machine (192.168.1.57 in the example above)
And the name of the printer you wrote down in the Queue: box (mine was: LaserJet 4L, note this is case sensitive and must match the printer's name exactly), click OK
Go to the File pulldown menu and Save As... and save it on your desktop with a name you'll remember, e.g. 192.168.1.57_LaserJet

Then you can quit the Desktop Printer Utility and next time you print in OS9 Machine you should get a Printer dialog box with a "Printer:" popup at the top which should be set to whatever you saved the printer on your desktop as. Then hit the Print button and it should print.


Information about lpr setup on OS X 10.2 with gimp-print and ghostscript

this page about Using a Shared OS X Printer on OS 9 piqued my interest. i had often wanted to print to my osx printers from os9 machines. i had never used the desktop printer utility or desktop printing, so i had to turn that on in os 9.

i had already installed the excellent gimp-print and ghostscript so i could print to an old HP LaserJet 4L (non-postscript) using a usb to parallel cable from OS X (i have 10.2.x (jaguar)) and even print postscript documents.

i had to do a couple of things different from the instructions on the above mentioned page to get it to work. my /etc/inet.d/printer file was slightly different. i had to add a services line at the top, and also a server arguments (otherwise the printer spewed garbage, i think it was passing postscript data directly to the non-postscript printer). these lines in "man cups-lpd" gave me the clue:

OPTIONS
       The -o option to cups-lpd inserts options  for  all  print
       queues.  Most often this is used to disable the "l" filter
       so that remote print  jobs  are  filtered  as  needed  for
       printing:

           printer stream tcp nowait lp /usr/lib/cups/daemon/cups-lpd cups-lpd  
       -o document-format=application/octet-stream

           server = /usr/lib/cups/daemon/cups-lpd
           server_args = -o document-format=application/octet-stream

       The  example shown resets the document format to be appli-
       cation/octet-stream, which forces  auto-detection  of  the
       print file type.

so, when i did the "cd /etc/inet.d/" and then "sudo pico printer" commands to edit my printer config for xinetd, this is the printer file contents:

service printer
{
        disable         = no
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = root
        server          = /usr/libexec/cups/daemon/cups-lpd
        server_args     = -o document-format=application/octet-stream
        groups          = yes
        flags           = REUSE
}


that started xinetd listening on port 515 for print jobs (after restarting xinetd). then i was able print from my other OS 9 machine by using the desktop printer utility to create an lpr printer queue, pointing to the ip address of the mac os x machine with the name of the printer as the queue name (LaserJet_4L in my case). if you're running a firewall, you'll have to poke a hole in it if you want to print from other machines. i havent yet tried printing from classic on the same machine.

you can use netstat in a terminal to see if the lpd is listening. the -f inet option shows ip connections, and the -a option shows all, including listening servers. if you add the -n option, it will show the numbers of the ports instead of names of known ports, and printer (lpd) is port 515. (if you execute that command, you should see a bunch of connections, but printer or 515 should be in there somewhere if lpd is running)

netstat -f inet -a

Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)

tcp4       0      0  *.printer              *.*                    LISTEN


up