Subject: misc/13135: /etc/rc.d/mountd inflexibly uses nfs_server rc.conf variable
To: None <gnats-bugs@gnats.netbsd.org>
From: Johnny C. Lam <lamj@stat.cmu.edu>
List: netbsd-bugs
Date: 06/07/2001 10:17:49
>Number: 13135
>Category: misc
>Synopsis: /etc/rc.d/mountd inflexibly uses nfs_server rc.conf variable
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: misc-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Thu Jun 07 07:16:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Johnny C. Lam
>Release: NetBSD-current from 20010406
>Organization:
Department of Statistics, Carnegie Mellon University
>Environment:
System: NetBSD localhost 1.5U NetBSD 1.5U (HOBBES) #0: Sat Apr 28 18:49:54 EDT 2001 jlam@hobbes.home.net:/usr/obj/usr/src/sys/arch/i386/compile/HOBBES i386
Architecture: i386
Machine: i386
>Description:
/etc/rc.d/mountd checks $nfs_server to see if it should run or not.
This makes it harder than it should be to turn on just mountd without
nfsd as when you want to run your own NFS server (like pkgsrc/security/cfs).
>How-To-Repeat:
Visual inspection of /etc/rc.d/mountd.
>Fix:
/etc/rc.d/mountd should have rcvar=$name like all the other scripts,
and /etc/rc.d/nfsd should use the required_vars mechanism to check that
mountd is also set to run, as is done by the following patch. This change
might be useful if pulled up for NetBSD 1.5.1.
--- defaults/rc.conf.orig Fri May 25 11:02:14 2001
+++ defaults/rc.conf Thu Jun 7 07:12:41 2001
@@ -170,9 +170,9 @@
# NFS daemons and parameters.
#
+mountd=NO mountd_flags="" # NFS mount requests daemon
nfs_client=NO # enable client daemons
nfs_server=NO # enable server daemons
- mountd_flags=""
nfsd_flags="-6tun 4"
lockd=NO lockd_flags=""
statd=NO statd_flags=""
--- rc.d/mountd.orig Mon May 7 16:47:56 2001
+++ rc.d/mountd Thu Jun 7 07:11:34 2001
@@ -9,7 +9,7 @@
. /etc/rc.subr
name="mountd"
-rcvar="nfs_server"
+rcvar=$name
command="/usr/sbin/${name}"
required_files="/etc/exports"
start_precmd="mountd_precmd"
--- rc.d/nfsd.orig Sat Jun 3 03:06:13 2000
+++ rc.d/nfsd Thu Jun 7 07:11:09 2001
@@ -11,7 +11,7 @@
name="nfsd"
rcvar="nfs_server"
command="/usr/sbin/${name}"
-required_vars="rpcbind"
+required_vars="mountd rpcbind"
load_rc_config $name
run_rc_command "$1"
>Release-Note:
>Audit-Trail:
>Unformatted: