|
|
pcnfsd is started from /etc/nfs. It reads the configuration file /etc/pcnfsd.conf if present, and then services RPC requests directed to program number 150001. This release of the pcnfsd daemon supports both version 1 and version 2 of the pcnfsd protocol.
The requests serviced by pcnfsd fall into three categories: authentication, printing, and other. Only the authentication and printing services have administrative significance.
wtmp offto the /etc/pcnfsd.conf file.
spooldir pathto the /etc/pcnfsd.conf file.
Once a client has mounted the spool directory using NFS and has transferred print data to a file in this directory, it will issue a PCNFSD_PR_START or PCNFSD2_PR_START request. pcnfsd handles this, and most other print-related requests, by constructing a command based on the printing services of the server operating system and executing the command using the identity of the PC user. Since this involves set-user-id privileges, pcnfsd must be run as root.
Every print request from the client includes the name of
the printer which is to be used. pcnfsd
interprets a printer as either a destination serviced by
the system print spooler, or as a virtual printer. Setting
up the system print spooler to handle a new printer is
described on the
lpadmin(ADM)
manual page. Virtual printers, known only to
pcnfsd clients, are defined by a line in the
/etc/pcnfsd.conf file of the following form:
printer name alias-for command
name is the name of the printer you want to define. alias-for is the name of a ``real'' printer which corresponds to this printer. For example, a request to display the queue for name will be translated into the corresponding request for the printer alias-for. If you have defined a printer in such a way that there is no ``real'' printer to which it corresponds, use a single ``-'' for this field. (See the definition of the printer test below for an example.) command is a command which will be executed whenever a file is printed on name. This command is executed by the Bourne shell, /bin/sh, using the -c option. For complex operations, you should construct an executable shell program and invoke that in command. Within command, the following tokens will be replaced:
Token | Substitution |
---|---|
$FILE | replaced by the full path name of the print data file. When the command has been executed, the file will be unlinked. |
$USER | replaced by the username of the user logged in to the client system |
$HOST | replaced by the host name of the client system |
printer rotated lw /usr/local/bin/enscript -2r $FILEIf a client system prints a job on the printer rotated, the utility enscript will be invoked to pre-process the file $FILE. In this case, the -2r option causes the file to be printed in two-column rotated format on the default PostScript printer. If the client requests a list of the print queue for the printer rotated, the pcnfsd daemon will translate this into a request for a listing for the printer lw.
printer test - /usr/bin/cp $FILE usr/tmp/$HOST-$USERThe printer test is used only for testing. Any file sent to this printer will be copied into /usr/tmp. Any request to list the queue, check the status, etc. of printer test will be rejected because the alias-for has been specified as ``-''.
printer printer1 - lp -c -dprinter1 -og $FILEPrint to printer1. If the print server cannot access the files to be printed, the -c option to lp must be specified to make spool copies for printing.