From owner-freebsd-bugs@FreeBSD.ORG Thu Jan 28 21:20:11 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F18FD1065670 for ; Thu, 28 Jan 2010 21:20:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C74098FC16 for ; Thu, 28 Jan 2010 21:20:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o0SLKBAG057976 for ; Thu, 28 Jan 2010 21:20:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o0SLKBDX057975; Thu, 28 Jan 2010 21:20:11 GMT (envelope-from gnats) Date: Thu, 28 Jan 2010 21:20:11 GMT Message-Id: <201001282120.o0SLKBDX057975@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Efstratios Karatzas Cc: Subject: Re: misc/137271: Cannot update /etc/host.conf when root filesystems mount read-only X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Efstratios Karatzas List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2010 21:20:12 -0000 The following reply was made to PR misc/137271; it has been noted by GNATS. From: Efstratios Karatzas To: bug-followup@freebsd.org, admin@lissyara.su Cc: Subject: Re: misc/137271: Cannot update /etc/host.conf when root filesystems mount read-only Date: Thu, 28 Jan 2010 23:18:00 +0200 Hi! Not sure if this belongs in the PR database, but I have a couple of quick fixes. fix a) step 1: append the following line to your /etc/rc.conf file sudo echo "nsswitch_host_conf=\"/usr/local/etc/host.conf\" " >> /etc/rc.conf You can of course change the pathname to whatever you desire, as well as the variable name as long as it begins with a "nsswitch_" prefix step 2: goto /etc/rc.d/nsswitch As you can see, in lines 93, 94 & and 97 the "/etc/host.conf" is hardcoded Replace it with the variable defined in /etc/rc.conf For example, line 93 becomes if [ ! -f $nsswitch_host_conf -o \ etc. So no more hardcoding! *But* I really doubt that changing the location of system configuration files is a wise thing to do. I would avoid this solution and go with the solution b instead. fix b) Just boot with read/write partition / so you can make /etc/host.conf a symbolic link to /usr/local/etc/host.conf or some other path of your picking. Then change to read only mode for the partition. Makes more sense and seems a lot safer. Hope this helps. Cheers -- Efstratios "GPF" Karatzas