http://www.mandrakeuser.org/docs/hardware/hcups4.html

MandrakeUser.Org - Your Mandrake-Linux Knowledge Base!

 
 

*DocIndex - Hardware

Printing With CUPS

Setup and Configuration III

* Clients Accessing The CUPS Server
- CUPS
- LPD
- Windows

Related Resources:

See Resources on article index

Modified: Nov. 15, 2000
Author: Tom Berger

 

Setup and Configuration III

* Clients Accessing The CUPS Server

The printers provided by a CUPS server (machine with the CUPS daemon running) can be accessed by a wide range of clients:

CUPS clients

The CUPS daemon broadcasts information about its printers and classes into the local network. Every machine in the local network which has a CUPS daemon running picks up these signals. Thus it knows which printers are available in the local network. So a CUPS client just needs to to start its CUPS daemon and it has access to all the printers on the local network. There's no need to configure anything. Note that the broadcasting happens only every 30 seconds, so it will take up to 30 seconds until your CUPS client sees all printers in your local network.

As has been told above, broadcasting only works when client and server are in the same local network.

If you do not like to have a CUPS daemon running on your client, simply turn it off:

chkconfig --del cups
service cups stop

and edit the file '/etc/cups/client.conf' to have these lines:

ServerName [name or IP of a server running the CUPS daemon]
DefaultPrinter [name of the printer you like to have as default]

You can choose every machine which runs the CUPS daemon in your network as a server. You do not only get access to its local printers, but also to all the printers which are broadcast at the server from other servers. DO NOT uninstall the CUPS package, it does not contain only the CUPS daemon, but also all the printing commands as lpr, lpq, and so on.
On such a daemon-less client you can print with all of the usual printing programs for CUPS: xpp, qtcups, or lpr.

* article index * top

LPD clients

To accept printing jobs from a remote LPD client (for example a machine with an older distribution than Mandrake 7.2 or with a commercial Unix), the CUPS server needs an additional daemon, the CUPS-LPD mini daemon. The CUPS Software Administrator's Manual recommends to start it via the 'inetd' daemon. This is also possible in Linux Mandrake 7.2, but Linux Mandrake 7.2 has the more modern 'xinetd'.
So at first check which of these daemons is running:

ps auxwww|grep inet

Look for inetd or xinetd. If neither is running, start 'xinetd' with:

chkconfig --add xinetd
service xinetd start

If 'xinetd' is running, add

service printer
{
socket_type = stream
protocol = tcp
wait = no
user = lp
server = /usr/lib/cups/daemon/cups-lpd
}

to the '/etc/xinetd.conf' file and restart 'xinetd':

service xinetd restart

If 'inetd' is used, add

printer stream tcp nowait lp /usr/lib/cups/daemon/cups-lpd cups-lpd

(that's one line)
to the file '/etc/inetd.conf' and restart 'inetd':

service inet restart

Now the CUPS-LPD mini daemon will be invoked on any LPD request sent to your server. On the client you have to configure a remote LPD printer where the host name is the name of the server and the queue name is the name of the CUPS queue for the printer. All queues are allowed, queues of printers locally defined on the server and also queues the server knows by a broadcast from another server. So when your server is called "paperwaster" and it has a CUPS queue called "laserjet", you simply configure an LPD queue on your client which sends the data to the "laserjet" of "paperwaster".

* article index * top

Windows Clients

For accessing your printers from clients running Microsoft Windows, you need to run Samba which makes the resources of your Linux machine available to the Windows clients. To activate it, you should have the 'samba' package installed (urpmi samba) and you have to start the SMB daemon:

chkconfig --add smb
service smb start

Samba on Linux Mandrake 7.2 is preconfigured to make all CUPS printers available on the guest account. So you can get started easily. Note that the default configuration uses the CUPS drivers of the printers and expects that you set up the printers as a "Generic PostScript" printer on the Windows clients. If you want to use the Windows drivers of the respective printer instead, you can do so by editing the print command (section '[printers}' in '/etc/smb.conf': the line with the -o raw option should be 'active', i.e without a leading ";", whereas and the line without "-o raw" is commented out (with a leading ";"). Restart the Samba daemon:

service smb restart

To restrict access you have to edit '/etc/smb.conf' and to restart the SMB daemon with

service smb restart

, too. Alternatively, you can use the Samba web configuration tool (SWAT) by going to http://localhost:901/.

* article index * top

 
Legal: All texts on this site are covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB (Tom Berger) and Mandrakesoft 1999-2002.