From owner-freebsd-bugs Sat Aug 11 11:50:11 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 83E9537B40B for ; Sat, 11 Aug 2001 11:50:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f7BIo0851471; Sat, 11 Aug 2001 11:50:00 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id EE23237B401 for ; Sat, 11 Aug 2001 11:47:12 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f7BIlCx51285; Sat, 11 Aug 2001 11:47:12 -0700 (PDT) (envelope-from nobody) Message-Id: <200108111847.f7BIlCx51285@freefall.freebsd.org> Date: Sat, 11 Aug 2001 11:47:12 -0700 (PDT) From: OGAWA Takaya To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: conf/29631: portmap not automatically enabled in /etc/rc Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 29631 >Category: conf >Synopsis: portmap not automatically enabled in /etc/rc >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Aug 11 11:50:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: OGAWA Takaya >Release: FreeBSD 4.4-PRERELEASE >Organization: >Environment: FreeBSD gandalf.middle.earth 4.4-PRERELEASE FreeBSD 4.4-PRERELEASE #5: Thu Aug 9 00:50:08 JST 2001 root@gandalf.middle.earth:/usr/obj/usr/src/sys/GANDALF i386 >Description: In /etc/rc, special care is taken so that portmap will be automatically enabled if either amd, nfs or nis enabled: chkdepend amd amd_enable portmap portmap_enable chkdepend NFS nfs_server_enable portmap portmap_enable chkdepend NIS nis_server_enable portmap portmap_enable chkdepend NIS nis_client_enable portmap portmap_enable Thanks to these lines, variable ${portmap_enable} will be set to "YES" if needed. However, /etc/rc later loads /etc/rc.firewall, which unconditionally reloads /etc/defaults/rc.conf (and /etc/rc.conf, if exists): if [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf source_rc_confs elif [ -r /etc/rc.conf ]; then . /etc/rc.conf fi Thus, unless user specifically set ${portmap_enable} to "YES" in /etc/rc.conf, ${portmap_enable} will be reset to "NO" in /etc/defaults/rc.conf. Later on, /etc/rc invokes network_pass2() (which defined in /etc/rc.network) but portmap won't be run because ${portmap_enable} has been reset to "NO". >How-To-Repeat: Create /etc/rc.conf as follows: nfs_server_enable="YES" And reboot the system. During bootup, rc shows: DEPENDENCY NOTE: portmap_enable will be enabled to support NFS However, % ps ax | grep portmap produces nothing. >Fix: In /etc/rc.firewall, don't reload /etc/rc.conf nor /etc/defaults/rc.conf if they are already loaded. /etc/rc.firewall6 already cares this so the same approach can be applied to /etc/rc.firewall as well. Patch is as follows: --- etc/rc.firewall.orig Sun Aug 12 03:13:37 2001 +++ etc/rc.firewall Sun Aug 12 03:17:58 2001 @@ -30,11 +30,13 @@ # # Suck in the configuration variables. -if [ -r /etc/defaults/rc.conf ]; then - . /etc/defaults/rc.conf - source_rc_confs -elif [ -r /etc/rc.conf ]; then - . /etc/rc.conf +if [ -z "${source_rc_confs_defined}" ]; then + if [ -r /etc/defaults/rc.conf ]; then + . /etc/defaults/rc.conf + source_rc_confs + elif [ -r /etc/rc.conf ]; then + . /etc/rc.conf + fi fi ############ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message