Do not indent global variables.
[netbsd-mini2440.git] / usr.sbin / rpc.pcnfsd / pcnfsd.8
blob968aef53a9ae77b3a45e2e43e6c87c0addae71e5
1 .\"     $NetBSD: pcnfsd.8,v 1.7 2002/01/19 11:45:00 wiz Exp $
2 .\" @(#) @(#)pcnfsd.8c  1.1 9/3/91;
3 .TH RPC.PCNFSD 8 "25 April 1991"
4 .SH NAME
5 pcnfsd, rpc.pcnfsd \- (PC)NFS authentication and print request server
6 .SH SYNOPSIS
7 .B /usr/sbin/rpc.pcnfsd
8 .SH DESCRIPTION
9 .LP
10 .B pcnfsd
11 is an
12 .SM RPC
13 server that supports Sun ONC clients on PC (DOS, OS/2, Macintosh, and other)
14 systems. This page describes version two of the
15 .B pcnfsd
16 server.
17 .LP
18 .B rpc.pcnfsd
19 may be started from
20 .B /etc/rc.local
21 or by the
22 .BR inetd (8)
23 superdaemon. It reads the configuration file
24 .B /etc/pcnfsd.conf
25 if present, and then services RPC requests directed to
26 program number 150001. This release of the
27 .B pcnfsd
28 daemon supports both version 1 and version 2 of the pcnfsd
29 protocol. Consult the
30 .B rpcgen
31 source file
32 .B pcnfsd.x
33 for details of the protocols.
34 .LP
35 The requests serviced by
36 .B pcnfsd
37 fall into three categories: authentication, printing, and other. Only the
38 authentication and printing services have administrative significance.
39 .SH AUTHENTICATION
40 When
41 .B pcnfsd
42 receives a
43 .B PCNFSD_AUTH
45 .B PCNFSD2_AUTH
46 request\**, it will "log in" the user by validating the username and
47 password and returning the corresponding uid, gids, home directory,
48 and umask. If
49 .B pcnfsd
50 was built with the
51 .B WTMP
52 compile-time option, it will also append a record to the
53 .BR wtmp (5)
54 data base. If you do not wish to record PC "logins" in this way,
55 you should add a line of the form
56 .RS
57 .sp
58 \fBwtmp off\fP
59 .sp
60 .RE
61 to the
62 .B /etc/pcnfsd.conf
63 file.
64 .SH PRINTING
65 .LP
66 .B pcnfsd
67 supports a printing model based on the use of NFS to transfer
68 the actual print data from the client to the server. The client system
69 issues a
70 .B PCNFSD_PR_INIT
72 .B PCNFSD2_PR_INIT
73 request, and the server returns the path to a spool directory which
74 the client may use and which is exported by NFS.
75 .B pcnfsd
76 creates a subdirectory for each of its clients: the parent
77 directory is normally
78 .B /export/pcnfs
79 and the subdirectory is the hostname of the client system.
80 If you wish to use a different parent directory, you should add a
81 line of the form
82 .RS
83 .sp
84 \fBspooldir\fP \fIpath\fP
85 .sp
86 .RE
87 to the
88 .B /etc/pcnfsd.conf
89 file.
90 .LP
91 Once a client has mounted the spool directory using NFS
92 and has transferred print data to a file in this directory, it
93 will issue a
94 .B PCNFSD_PR_START
96 .B PCNFSD2_PR_START
97 request.
98 .B pcnfsd
99 handles this, and most other print-related requests, by
100 constructing a command based on the printing services of
101 the server operating system and executing the command using the
102 identity of the PC user. Since this involves set-user-id privileges,
103 .B pcnfsd
104 must be run as root.
106 Every print request from the client includes the name of the printer
107 which is to be used. In SunOS, this name corresponds to a printer
108 definition in the
109 .BR /etc/printcap (5)
110 database. If you wish to define a non-standard way of processing
111 print data, you should define a new printer and arrange for the
112 client to print to this printer. There are two ways of setting up a new printer.
113 The first involves the addition of an entry to
114 .BR /etc/printcap (5)
115 and the creation of filters to perform the required processing. This
116 is outside the scope of this discussion. In addition,
117 .B pcnfsd
118 includes a mechanism by which  you can define virtual printers known
119 only to
120 .B pcnfsd
121 clients. Each printer is defined by a line in the
122 .B /etc/pcnfsd.conf
123 file of the following form
126 \fBprinter\fP \fIname alias-for command\fP
129 \fIname\fP is the name of the printer you want to define. \fIalias-for\fP
130 is the name of a "real" printer which corresponds to this printer. For
131 example, a request to
132 display the queue for \fIname\fP will be translated into the
133 corresponding request for the printer \fIalias-for\fP. If you have
134 defined a printer in such a way that there is no "real" printer to
135 which it corresponds, use a single "-" for this field. (See the
136 definition of the printer
137 .B test
138 below for an example.) \fIcommand\fP is a
139 command which will be executed whenever a file is printed on \fIname\fP.
140 This command is executed by the Bourne shell,
141 .B /bin/sh
142 using the
143 .B -c
144 option. For complex operations you should
145 construct an executable shell program and invoke that in \fIcommand\fP.
146 Within \fIcommand\fP the following tokens will be replaced:
148 .TP 10
149 .B Token
150 .B Substitution
152 .SB $FILE
153 Replaced by the full path name of the print data file. When
154 the command has been executed, the file will be unlinked.
156 .SB $USER
157 Replaced by the username of the user logged in to the client system.
159 .SB $HOST
160 Replaced by the host name of the client system.
162 Consider the following example
163 .B /etc/pcnfsd.conf
164 file:
167 printer rotated lw /usr/local/bin/enscript -2r \s-2$FILE\s0
169 printer test - /usr/bin/cp \s-2$FILE\s0 /usr/tmp/\s-2$HOST\s0-\s-2$USER\s0
172 If a client system prints a job on the printer
173 .B rotated
174 the utility
175 .B enscript
176 will be invoked to pre-process the file \s-2$FILE\s0. In this
177 case, the
178 .B -2r
179 option causes the file to be printed in two-column rotated format
180 on the default PostScript\(rg printer.
181 If the client requests a list of the print queue for the printer
182 .B rotated
184 .B pcnfsd
185 daemon will translate this into a request for a listing for
186 the printer
187 .B lw.
189 The printer
190 .B test
191 is used only for testing. Any file sent to this printer
192 will be copied into
193 .B /usr/tmp.
194 Any request to list the queue, check the status, etc. of printer
195 .B test
196 will be rejected because the \fIalias-for\fP has been specified as "-".
197 .SH FILES
198 .PD 0
199 .TP 20
200 .B /etc/pcnfsd.conf
201 configuration file
202 .TP 20
203 .B /export/pcnfs
204 default print spool directory
206 .SH "SEE ALSO"
207 .BR lpr (1),
208 .BR lpc (8)
209 .SH HISTORY
211 .B pcnfsd
212 source code is distributed by Sun Microsystems, Inc. with their
213 .SM PC/NFS
214 product under terms described in common.h in that source code.
215 Those terms require that you be informed that this version of
216 .B pcnfsd
217 was modified to run on NetBSD and is NOT supported by Sun.