From 197f57d4a220f2a530d9440e373a47e31ea1087b Mon Sep 17 00:00:00 2001 From: robert Date: Sat, 12 Jul 2014 15:32:43 +0000 Subject: [PATCH] replace the heavy shell magic in quirks to handle backward compat with simpler methods --- etc/rc.d/rc.subr | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr index f6190913c85..2b489bacb75 100644 --- a/etc/rc.d/rc.subr +++ b/etc/rc.d/rc.subr @@ -1,4 +1,4 @@ -# $OpenBSD: rc.subr,v 1.73 2014/07/12 10:14:03 robert Exp $ +# $OpenBSD: rc.subr,v 1.74 2014/07/12 15:32:43 robert Exp $ # # Copyright (c) 2010, 2011, 2014 Antoine Jacoutot # Copyright (c) 2010, 2011 Ingo Schwarze @@ -89,8 +89,6 @@ _rc_wait() { } _rc_quirks() { - unset mountd_flags nfsd_flags ypbind_flags - # special care needed for spamlogd to avoid starting it up and failing # all the time if [ X"${spamd_flags}" = X"NO" -o X"${spamd_black}" != X"NO" ]; then @@ -103,9 +101,15 @@ _rc_quirks() { pflogd_flags=NO fi - : ${mountd_flags=$([ X"${nfs_server-NO}" = XYES ] || echo NO)} - : ${nfsd_flags=$([ X"${nfs_server-NO}" = XYES ] && echo "-tun 4" || echo NO)} - : ${ypbind_flags=$([ X"`domainname`" != X"" -a -d /var/yp/binding ] || echo NO)} + # special care needed if nfs_server=YES to startup nfsd and mountd with + # sane default flags + if [ X"${nfs_server}" = X"YES" ]; then + [ X"${nfsd_flags}" = X"NO" ] && nfsd_flags="-tun 4" + [ X"${mountd_flags}" = X"NO" ] && mountd_flags= + fi + + # in case domainname is set and /var/yp/binding exists enable ypbind + [ X"`domainname`" != X"" -a -d /var/yp/binding ] && ypbind_flags= } _rc_parse_conf() { -- 2.20.1