Date: Thu, 28 Jan 2010 21:20:11 GMT From: Efstratios Karatzas <gpf.kira@gmail.com> To: freebsd-bugs@FreeBSD.org Subject: Re: misc/137271: Cannot update /etc/host.conf when root filesystems mount read-only Message-ID: <201001282120.o0SLKBDX057975@freefall.freebsd.org>
index | next in thread | raw e-mail
The following reply was made to PR misc/137271; it has been noted by GNATS. From: Efstratios Karatzas <gpf.kira@gmail.com> 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" Karatzashelp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001282120.o0SLKBDX057975>
