Gentoo Archives: gentoo-commits

From: "Javier Villavicencio (the_paya)" <the_paya@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-freebsd/freebsd-usbin/files: rpc.lockd.initd nfs.initd rpc.statd.initd freebsd-usbin-7.0-nowrap.patch nfs.confd
Date: Thu, 22 Jan 2009 21:06:33
Message-Id: E1LQ6kt-0007yJ-NT@stork.gentoo.org
1 the_paya 09/01/22 21:06:27
2
3 Modified: nfs.initd nfs.confd
4 Added: rpc.lockd.initd rpc.statd.initd
5 freebsd-usbin-7.0-nowrap.patch
6 Log:
7 Import of the 7.1 ebuilds from gentoo-bsd overlay.
8 (Portage version: 2.2_rc23/cvs/FreeBSD i386)
9
10 Revision Changes Path
11 1.3 sys-freebsd/freebsd-usbin/files/nfs.initd
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-usbin/files/nfs.initd?rev=1.3&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-usbin/files/nfs.initd?rev=1.3&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-usbin/files/nfs.initd?r1=1.2&r2=1.3
16
17 Index: nfs.initd
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-usbin/files/nfs.initd,v
20 retrieving revision 1.2
21 retrieving revision 1.3
22 diff -u -r1.2 -r1.3
23 --- nfs.initd 6 Apr 2007 14:47:17 -0000 1.2
24 +++ nfs.initd 22 Jan 2009 21:06:27 -0000 1.3
25 @@ -1,209 +1,54 @@
26 #!/sbin/runscript
27 -# Copyright 1999-2005 Gentoo Foundation
28 +# Copyright 1999-2008 Gentoo Foundation
29 # Distributed under the terms of the GNU General Public License v2
30 -# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-usbin/files/nfs.initd,v 1.2 2007/04/06 14:47:17 uberlord Exp $
31
32 #---------------------------------------------------------------------------
33 -# This script starts/stops the following
34 -# rpc.statd if necessary (also checked by init.d/nfsmount)
35 -# rpc.rquotad if exists (from quota package)
36 -# rpc.nfsd
37 -# rpc.mountd
38 +# This script starts/stops nfsd and mountd
39 +# Daemons rpc.rquotad, rpc.rstatd, rpc.rusersd, rpc.rwalld and rpc.sprayd
40 +# should be started from inetd on FreeBSD.
41 #---------------------------------------------------------------------------
42
43 -# NB: Config is in /etc/conf.d/nfs
44 -
45 opts="reload"
46
47 -# This variable is used for controlling whether or not to run exportfs -ua;
48 -# see stop() for more information
49 -restarting=no
50 -
51 # The binary locations
52 -exportfs=/usr/sbin/exportfs
53 -statd=/usr/sbin/rpc.statd
54 -idmapd=/usr/sbin/rpc.idmapd
55 -rquotad=/usr/sbin/rpc.rquotad
56 -nfsd=/usr/sbin/rpc.nfsd
57 -mountd=/usr/sbin/rpc.mountd
58 +nfsd=/usr/sbin/nfsd
59 +mountd=/usr/sbin/mountd
60
61 depend() {
62 - use ypbind net
63 + use ypbind net rpc.lockd
64 need rpcbind
65 after quota
66 }
67
68 -start_idmapd() {
69 - [ ! -x "${idmapd}" ] && return 0
70 -
71 - if grep -q rpc_pipefs /proc/filesystems ; then
72 - if ! grep -q "rpc_pipefs /var/lib/nfs/rpc_pipefs" /proc/mounts ; then
73 - [ ! -d /var/lib/nfs/rpc_pipefs ] && mkdir -p /var/lib/nfs/rpc_pipefs
74 - ebegin "Mounting RPC pipefs"
75 - mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
76 - eend $?
77 - fi
78 - fi
79 -
80 - ebegin "Starting idmapd"
81 - ${idmapd} ${RPCIDMAPDOPTS}
82 - eend $?
83 -}
84 -
85 -stop_idmapd() {
86 - [ ! -x ${idmapd} ] && return 0
87 -
88 - ebegin "Stopping idmapd"
89 - start-stop-daemon --stop --quiet --exec ${idmapd}
90 - ret=$?
91 - eend ${ret}
92 -
93 - if [ $restarting = "no" -a "${RC_CMD}" != "restart" ] ; then
94 - if grep -q "rpc_pipefs /var/lib/nfs/rpc_pipefs" /proc/mounts ; then
95 - ebegin "Unmounting RPC pipefs"
96 - umount /var/lib/nfs/rpc_pipefs
97 - eend $?
98 - fi
99 - fi
100 -
101 - return ${ret}
102 -}
103 -
104 -start_statd() {
105 - # Don't start rpc.statd if already started by init.d/nfsmount
106 - killall -0 rpc.statd 2>/dev/null && return 0
107 - ebegin "Starting NFS statd"
108 - start-stop-daemon --start --quiet --exec \
109 - $statd -- $RPCSTATDOPTS 1>&2
110 - eend $? "Error starting NFS statd"
111 -}
112 -
113 -stop_statd() {
114 - # Don't stop rpc.statd if it's in use by init.d/nfsmount.
115 - mount -t nfs | grep -q . && return 0
116 - # Make sure it's actually running
117 - killall -0 rpc.statd 2>/dev/null || return 0
118 - # Okay, all tests passed, stop rpc.statd
119 - ebegin "Stopping NFS statd"
120 - start-stop-daemon --stop --quiet --exec $statd 1>&2
121 - eend $? "Error stopping NFS statd"
122 -}
123 -
124 -waitfor_exportfs() {
125 - local pid=$1
126 - ( sleep ${EXPORTFSTIMEOUT:-30}; kill -9 $pid 2>/dev/null ) &
127 - wait $1
128 -}
129 -
130 start() {
131 - # Make sure nfs support is loaded in the kernel #64709
132 - if [ -e /proc/modules ] ; then
133 - modprobe nfsd &> /dev/null
134 - fi
135 -
136 - # This is the new "kernel 2.6 way" to handle the exports file
137 - if grep -q nfsd /proc/filesystems 2>/dev/null; then
138 - if ! grep -q "nfsd /proc/fs/nfs" /proc/mounts 2>/dev/null; then
139 - ebegin "Mounting nfsd filesystem in /proc"
140 - mount -t nfsd nfsd /proc/fs/nfs
141 - eend $? "Error mounting nfsd filesystem in /proc"
142 - fi
143 - fi
144 - # now that nfsd is mounted inside /proc, we can safely start mountd later
145 -
146 - start_idmapd
147 - start_statd
148 -
149 - # Exportfs likes to hang if networking isn't working.
150 - # If that's the case, then try to kill it so the
151 - # bootup process can continue.
152 - if grep -q '^/' /etc/exports 2>/dev/null; then
153 - ebegin "Exporting NFS directories"
154 - $exportfs -r 1>&2 &
155 - waitfor_exportfs $!
156 - eend $? "Error exporting NFS directories"
157 - fi
158 -
159 - if [ -x "${rquotad}" ]; then
160 - ebegin "Starting NFS rquotad"
161 - start-stop-daemon --start --quiet --exec \
162 - $rquotad -- $RPCRQUOTADOPTS 1>&2
163 - eend $? "Error starting NFS rquotad"
164 - fi
165 -
166 ebegin "Starting NFS daemon"
167 start-stop-daemon --start --quiet --exec \
168 - $nfsd -- $RPCNFSDCOUNT 1>&2
169 + $nfsd -- ${nfsdopts}
170 eend $? "Error starting NFS daemon"
171
172 # Start mountd
173 ebegin "Starting NFS mountd"
174 start-stop-daemon --start --quiet --exec \
175 - $mountd -- $RPCMOUNTDOPTS 1>&2
176 + $mountd -- ${mountdopts} ${exporstfile}
177 eend $? "Error starting NFS mountd"
178 }
179
180 stop() {
181 - # Don't check NFSSERVER variable since it might have changed,
182 - # instead use --oknodo to smooth things over
183 ebegin "Stopping NFS mountd"
184 - start-stop-daemon --stop --quiet --oknodo \
185 - --exec $mountd 1>&2
186 + start-stop-daemon --stop --quiet --oknodo --exec $mountd \
187 + --pidfile /var/run/mountd.pid
188 eend $? "Error stopping NFS mountd"
189
190 - # nfsd sets its process name to [nfsd] so don't look for $nfsd
191 ebegin "Stopping NFS daemon"
192 start-stop-daemon --stop --quiet --oknodo \
193 - --name nfsd --user root --signal 2 1>&2
194 + --name nfsd --user root
195 eend $? "Error stopping NFS daemon"
196 -
197 - if [ -x $rquotad ]; then
198 - ebegin "Stopping NFS rquotad"
199 - start-stop-daemon --stop --quiet --oknodo \
200 - --exec $rquotad 1>&2
201 - eend $? "Error stopping NFS rquotad"
202 - fi
203 -
204 - # When restarting the NFS server, running "exportfs -ua" probably
205 - # isn't what the user wants. Running it causes all entries listed
206 - # in xtab to be removed from the kernel export tables, and the
207 - # xtab file is cleared. This effectively shuts down all NFS
208 - # activity, leaving all clients holding stale NFS filehandles,
209 - # *even* when the NFS server has restarted.
210 - #
211 - # That's what you would want if you were shutting down the NFS
212 - # server for good, or for a long period of time, but not when the
213 - # NFS server will be running again in short order. In this case,
214 - # then "exportfs -r" will reread the xtab, and all the current
215 - # clients will be able to resume NFS activity, *without* needing
216 - # to umount/(re)mount the filesystem.
217 - if [ "$restarting" = no -a "${RC_CMD}" != "restart" ]; then
218 - ebegin "Unexporting NFS directories"
219 - # Exportfs likes to hang if networking isn't working.
220 - # If that's the case, then try to kill it so the
221 - # shutdown process can continue.
222 - $exportfs -ua 1>&2 &
223 - waitfor_exportfs $!
224 - eend $? "Error unexporting NFS directories"
225 - fi
226 -
227 - stop_statd
228 - stop_idmapd
229 }
230
231 reload() {
232 - # Exportfs likes to hang if networking isn't working.
233 - # If that's the case, then try to kill it so the
234 - # bootup process can continue.
235 + # Hangup signal to mountd reloads /etc/exports.
236 ebegin "Reloading /etc/exports"
237 - $exportfs -r 1>&2 &
238 - waitfor_exportfs $!
239 - eend $? "Error exporting NFS directories"
240 -}
241 -
242 -restart() {
243 - # See long comment in stop() regarding "restarting" and exportfs -ua
244 - restarting=yes
245 - svc_stop
246 - svc_start
247 + start-stop-daemon --signal 1 --quiet --exec $mountd \
248 + --pidfile /var/run/mountd.pid
249 + eend $?
250 }
251
252
253
254 1.2 sys-freebsd/freebsd-usbin/files/nfs.confd
255
256 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-usbin/files/nfs.confd?rev=1.2&view=markup
257 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-usbin/files/nfs.confd?rev=1.2&content-type=text/plain
258 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-usbin/files/nfs.confd?r1=1.1&r2=1.2
259
260 Index: nfs.confd
261 ===================================================================
262 RCS file: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-usbin/files/nfs.confd,v
263 retrieving revision 1.1
264 retrieving revision 1.2
265 diff -u -r1.1 -r1.2
266 --- nfs.confd 1 Apr 2006 16:43:51 -0000 1.1
267 +++ nfs.confd 22 Jan 2009 21:06:27 -0000 1.2
268 @@ -1,24 +1,10 @@
269 -# /etc/conf.d/nfs
270 -# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-usbin/files/nfs.confd,v 1.1 2006/04/01 16:43:51 flameeyes Exp $
271 -
272 # Config file for /etc/init.d/nfs
273 -
274 -# If you wish to set the port numbers for lockd,
275 -# please see /etc/sysctl.conf
276 -
277 -# Number of servers to be started up by default
278 -RPCNFSDCOUNT=8
279 -
280 -# Options to pass to rpc.mountd
281 -# ex. RPCMOUNTDOPTS="-p 32767
282 -RPCMOUNTDOPTS=""
283 -
284 -# Options to pass to rpc.statd
285 -# ex. RPCSTATDOPTS="-p 32765 -o 32766"
286 -RPCSTATDOPTS=""
287 -
288 -# Options to pass to rpc.idmapd
289 -RPCIDMAPDOPTS=""
290 -
291 -# Timeout (in seconds) for exportfs
292 -EXPORTFSTIMEOUT=30
293 +# Options for nfsd (see man nfsd)
294 +# Example: 8 nfsd servers started:
295 +#nfsdopts="-n 8"
296 +
297 +# Options for mountd (see man mountd)
298 +# Example: allow non-root users to mount shares:
299 +#mountdopts="-n"
300 +# Specify t he exports file, this is the default:
301 +#exportsfile="/etc/exports"
302
303
304
305 1.1 sys-freebsd/freebsd-usbin/files/rpc.lockd.initd
306
307 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-usbin/files/rpc.lockd.initd?rev=1.1&view=markup
308 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-usbin/files/rpc.lockd.initd?rev=1.1&content-type=text/plain
309
310 Index: rpc.lockd.initd
311 ===================================================================
312 #!/sbin/runscript
313 # Copyright 1999-2008 Gentoo Foundation
314 # Distributed under the terms of the GNU General Public License v2
315
316 depend() {
317 need net rpcbind rpc.statd
318 }
319
320 start() {
321 ebegin "Starting NFS lockd"
322 start-stop-daemon --start --quiet --exec \
323 /usr/sbin/rpc.lockd -- $rpclockdopts
324 eend $? "Error starting NFS lockd"
325 }
326
327 stop() {
328 ebegin "Stopping NFS lockd"
329 start-stop-daemon --stop --quiet --exec /usr/sbin/rpc.lockd
330 eend $? "Error stopping NFS lockd"
331 }
332
333
334
335 1.1 sys-freebsd/freebsd-usbin/files/rpc.statd.initd
336
337 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-usbin/files/rpc.statd.initd?rev=1.1&view=markup
338 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-usbin/files/rpc.statd.initd?rev=1.1&content-type=text/plain
339
340 Index: rpc.statd.initd
341 ===================================================================
342 #!/sbin/runscript
343 # Copyright 1999-2008 Gentoo Foundation
344 # Distributed under the terms of the GNU General Public License v2
345
346 depend() {
347 need net rpcbind
348 }
349
350 start() {
351 ebegin "Starting NFS statd"
352 start-stop-daemon --start --quiet --exec \
353 /usr/sbin/rpc.statd -- $rpcstatdopts
354 eend $? "Error starting NFS statd"
355 }
356
357 stop() {
358 ebegin "Stopping NFS statd"
359 start-stop-daemon --stop --quiet --exec /usr/sbin/rpc.statd
360 eend $? "Error stopping NFS statd"
361 }
362
363
364
365 1.1 sys-freebsd/freebsd-usbin/files/freebsd-usbin-7.0-nowrap.patch
366
367 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-usbin/files/freebsd-usbin-7.0-nowrap.patch?rev=1.1&view=markup
368 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-usbin/files/freebsd-usbin-7.0-nowrap.patch?rev=1.1&content-type=text/plain
369
370 Index: freebsd-usbin-7.0-nowrap.patch
371 ===================================================================
372 diff -ur usr.sbin.orig/rpcbind/Makefile usr.sbin/rpcbind/Makefile
373 --- usr.sbin.orig/rpcbind/Makefile 2007-04-21 12:02:30 +0000
374 +++ usr.sbin/rpcbind/Makefile 2007-04-21 12:05:32 +0000
375 @@ -8,13 +8,20 @@
376 SRCS= check_bound.c rpcb_stat.c rpcb_svc_4.c rpcbind.c pmap_svc.c \
377 rpcb_svc.c rpcb_svc_com.c security.c warmstart.c util.c
378
379 -CFLAGS+= -DPORTMAP -DLIBWRAP
380 +CFLAGS+= -DPORTMAP
381
382 .if ${MK_INET6_SUPPORT} != "no"
383 CFLAGS+= -DINET6
384 .endif
385
386 -DPADD= ${LIBWRAP} ${LIBUTIL}
387 -LDADD= -lwrap -lutil
388 +DPADD= ${LIBUTIL}
389 +LDADD= -lutil
390 +
391 +.if !defined(NO_WRAP)
392 +CFLAGS+= -DTCP_WRAPPER
393 +DPADD+= ${LIBWRAP}
394 +LDADD+= -lwrap
395 +.endif
396 +
397
398 .include <bsd.prog.mk>
399 diff -ur usr.sbin.orig/ypserv/Makefile usr.sbin/ypserv/Makefile
400 --- usr.sbin.orig/ypserv/Makefile 2007-04-21 12:02:31 +0000
401 +++ usr.sbin/ypserv/Makefile 2007-04-21 12:06:53 +0000
402 @@ -8,10 +8,13 @@
403 SRCS= yp_svc.c yp_server.c yp_dblookup.c yp_dnslookup.c \
404 ypxfr_clnt.c yp.h yp_main.c yp_error.c yp_access.c yp_svc_udp.c
405
406 -CFLAGS+= -DDB_CACHE -DTCP_WRAPPER -I.
407 +CFLAGS+= -DDB_CACHE -I.
408
409 +.if !defined(NO_WRAP)
410 +CFLAGS+= -DTCP_WRAPPER
411 DPADD= ${LIBWRAP}
412 LDADD= -lwrap
413 +.endif
414
415 CLEANFILES= yp_svc.c ypxfr_clnt.c yp.h