Browse Source

Optimize checks for /etc/exports.

from robert at peichaer dot org
discussed with and ok halex@
OPENBSD_5_3
ajacoutot 12 years ago
parent
commit
b3070ea3a2
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      src/etc/rc.d/mountd
  2. +2
    -2
      src/etc/rc.d/nfsd

+ 2
- 2
src/etc/rc.d/mountd View File

@ -1,13 +1,13 @@
#!/bin/sh #!/bin/sh
# #
# $OpenBSD: mountd,v 1.2 2011/08/02 11:59:25 robert Exp $
# $OpenBSD: mountd,v 1.3 2012/08/14 07:43:57 ajacoutot Exp $
daemon="/sbin/mountd" daemon="/sbin/mountd"
. /etc/rc.d/rc.subr . /etc/rc.d/rc.subr
rc_pre() { rc_pre() {
[ -s /etc/exports -a `sed -e '/^#/d' < /etc/exports | wc -l` -ne 0 ] &&
[ -s /etc/exports ] && grep -qv '^#' /etc/exports && \
rm -f /var/db/mountdtab && \ rm -f /var/db/mountdtab && \
echo -n > /var/db/mountdtab echo -n > /var/db/mountdtab
} }


+ 2
- 2
src/etc/rc.d/nfsd View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# $OpenBSD: nfsd,v 1.4 2012/07/10 15:03:24 halex Exp $
# $OpenBSD: nfsd,v 1.5 2012/08/14 07:43:57 ajacoutot Exp $
daemon="/sbin/nfsd" daemon="/sbin/nfsd"
@ -11,7 +11,7 @@ pexp="(${daemon}( |$)|nfsd: (master|server)$)"
rc_reload=NO rc_reload=NO
rc_pre() { rc_pre() {
[ -s /etc/exports -a `sed -e '/^#/d' < /etc/exports | wc -l` -ne 0 ]
[ -s /etc/exports ] && grep -qv '^#' /etc/exports
} }
rc_cmd $1 rc_cmd $1

Loading…
Cancel
Save