summaryrefslogtreecommitdiff
path: root/usr.sbin/ypserv/ypinit/Makefile.yp.8
blob: f0695ec91e5429e9d716800fc6e06c6bdd795762 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
.\"	$OpenBSD: Makefile.yp.8,v 1.6 2010/01/20 23:20:28 schwarze Exp $
.\"
.\" Copyright (c) 2008 Ingo Schwarze <schwarze@usta.de>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: January 20 2010 $
.Dt MAKEFILE.YP 8
.Os
.Sh NAME
.Nm Makefile.yp
.Nd generate and distribute YP maps
.Sh SYNOPSIS
.Li cd /var/yp; make
.Sh DESCRIPTION
The
.Nm
utility generates or updates the YP maps to be served by
.Xr ypserv 8 .
.Pp
Each YP domain to be served must have its own subdirectory below
.Pa /var/yp .
Use
.Xr ypinit 8
to set up such subdirectories.
In particular,
.Xr ypinit 8
will copy
.Pa /var/yp/Makefile.yp
into each new domain subdirectory.
For common configuration changes affecting all future domains, edit
.Pa /var/yp/Makefile.yp
before running
.Xr ypinit 8 .
For configuration changes affecting only one individual domain, edit the
.Pa Makefile
in the respective domain subdirectory after running
.Xr ypinit 8 .
Do
.Em not
edit
.Pa /var/yp/Makefile.yp.dist .
.Pp
By default, input data for generating YP maps is collected from the
.Pa /etc
directory.
Edit the
.Dv DIR
variable to choose a different source directory.
.Pp
To regenerate all maps for all domains, run
.Xr make 1
in
.Pa /var/yp .
To regenerate all maps for one single domain, run
.Xr make 1
in the respective domain subdirectory.
The
.Xr makedbm 8
utility will be used to create the maps in
.Xr db 3
format, and they will be stored inside the appropriate domain subdirectory.
.Pp
Whenever a YP map has been updated, it is automatically distributed to all
slave servers in the respective domain using the
.Xr yppush 8
utility.
To disable automatic distribution, set the
.Dv NOPUSH
variable to an arbitrary, non-empty, value.
.Sh STANDARD YP MAPS
By default,
.Nm
provides the following
.Xr make 1
targets:
.Bl -tag -width protocols
.It Ic passwd
Generates the
.Pa passwd.byname ,
.Pa passwd.byuid ,
.Pa master.passwd.byname ,
and
.Pa master.passwd.byuid
maps from
.Xr master.passwd 5
for use by
.Xr getpwent 3 .
.Pp
The
.Pa master.passwd.*\&
maps always contain complete records in
.Xr master.passwd 5
format, including the encrypted passwords.
.Pp
The
.Pa passwd.*\&
maps follow the reduced
.Xr passwd 5
format having the class, change, and expire fields removed but by default
the encrypted passwords are included too.
If the
.Dv UNSECURE
variable is changed to be empty, the encrypted passwords are replaced by
asterisks
.Pq Ql \&* .
This
.Dq secure
mode is compatible with
.Ox
and
.Fx
clients.
.Pp
The
.Dv MINUID
and
.Dv MAXUID
variables restrict the range of user IDs included into the four passwd maps.
By default, system users are not included.
.It Ic netgroup
Generates the
.Pa netgroup ,
.Pa netgroup.byuser ,
and
.Pa netgroup.byhost
maps from
.Xr netgroup 5
for use by
.Xr getnetgrent 3
and
.Xr passwd 5 .
Requires the
.Xr revnetgroup 8
utility.
.It Ic group
Generates the
.Pa group.byname
and
.Pa group.bygid
maps from
.Xr group 5
for use by
.Xr getgrent 3 .
.Pp
The
.Dv MINGID
and
.Dv MAXGID
variables restrict the range of group IDs included into both group maps.
By default, system groups are not included.
.It Ic netid
Generates the
.Pa netid.byname
map from
.Xr netid 5 ,
.Xr passwd 5 ,
.Xr group 5 ,
and
.Xr hosts 5
for use by
.Xr getgrouplist 3 .
Falls back to
.Xr master.passwd 5
in case
.Xr passwd 5
is not available.
Requires the
.Xr mknetid 8
utility.
.It Ic hosts
Generates the
.Pa hosts.byname
and
.Pa hosts.byaddr
maps from
.Xr hosts 5
for use by
.Xr gethostbyname 3 .
Requires the
.Xr stdhosts 8
utility.
.Pp
To get
.Xr ypserv 8
to ask DNS for unknown hosts, set the
.Dv USEDNS
variable to
.Fl b .
.It Ic ethers
Generates the
.Pa ethers.byaddr
and
.Pa ethers.byname
maps from
.Xr ethers 5
for use by
.Xr ethers 3 .
Requires the
.Xr stdethers 8
utility.
.It Ic networks
Generates the
.Pa networks.byname
and
.Pa networks.byaddr
maps from
.Xr networks 5
for use by
.Xr getnetent 3 .
.It Ic rpc
Generates the
.Pa rpc.bynumber
map from
.Xr rpc 5
for use by
.Xr getrpcent 3 .
.It Ic services
Generates the
.Pa services.byname
map from
.Xr services 5
for use by
.Xr getservent 3 .
.It Ic protocols
Generates the
.Pa protocols.byname
and
.Pa protocols.bynumber
maps from
.Xr protocols 5
for use by
.Xr getprotoent 3 .
.It Ic aliases
Generates the
.Pa mail.aliases
and
.Pa mail.byaddr
maps from
.Xr aliases 5 .
This target uses both
.Xr sendmail 8
with the option
.Fl bi
and the
.Xr mkalias 8
utility.
.It Ic amd.home
Generates the
.Pa amd.home
map from the file
.Pa /etc/amd/amd.home .
.It Ic all
Generates all of the above, and sends a hangup signal to
.Xr ypserv 8
such that it uses the new maps.
.El
.Pp
In order to keep additional custom YP maps up to date, the
.Pa Makefile
should be extended to support additional targets.
.Sh FILES
.Bl -tag -width "/var/yp/domainname/ypservers.db" -compact
.It /var/yp/Makefile
Top level YP Makefile.
.It /var/yp/ Ns Ar domainname Ns /Makefile
Per domain YP maps Makefile.
.It /var/yp/ Ns Ar domainname Ns /ypservers.db
Database of hosts serving this domain.
.It /var/yp/ Ns Ar domainname/mapname Ns .db
Database files containing the YP maps.
.It /var/yp/ Ns Ar domainname/target Ns .time
Cookies controlling the operation of
.Xr make 1 .
.El
.Sh SEE ALSO
.Xr make 1 ,
.Xr db 3 ,
.Xr makedbm 8 ,
.Xr yp 8 ,
.Xr ypinit 8 ,
.Xr yppush 8 ,
.Xr ypserv 8
.Sh BUGS
When
.Dv NOPUSH
is set and individual maps are regenerated (as opposed to
.Ic all ) ,
the hangup signal to
.Xr ypserv 8
must be sent manually, or the new maps won't be used.
.Pp
When
.Dv NOPUSH
is unset, maps are pushed to the master server on the local host too,
slowing down
.Nm .