From owner-freebsd-current Thu May 11 10:27:15 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id KAA06919 for current-outgoing; Thu, 11 May 1995 10:27:15 -0700 Received: from gndrsh.aac.dev.com (gndrsh.aac.dev.com [198.145.92.241]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id KAA06907 for ; Thu, 11 May 1995 10:27:12 -0700 Received: (from rgrimes@localhost) by gndrsh.aac.dev.com (8.6.11/8.6.9) id KAA10530; Thu, 11 May 1995 10:25:39 -0700 From: "Rodney W. Grimes" Message-Id: <199505111725.KAA10530@gndrsh.aac.dev.com> Subject: Re: bug in /usr/src/etc/rc (netstart) To: kuku@gilberto.physik.rwth-aachen.de Date: Thu, 11 May 1995 10:25:39 -0700 (PDT) Cc: freebsd-current@freefall.cdrom.com In-Reply-To: <199505110624.IAA15370@gilberto.physik.rwth-aachen.de> from "Christoph Kukulies" at May 11, 95 08:24:33 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1648 Sender: current-owner@FreeBSD.org Precedence: bulk > > > > > > > > > > > > netstart is started using sh /etc/netstart (that was a . /etc/netstart > > > formerly and it used to work). Now, starting it with sh /etc/netstart > > > $hostname is unknown and the consequences are quite unfriendly. > > > > Hostname should be set by /etc/sysconfig, /etc/sysconfig is .'ed into > > /etc/rc. Infact all variables that where set in /etc/netstart should > > now be set by /etc/sysconfig. > > > > Do you infact have /etc/sysconfig 1.11, /etc/rc 1.63 ? > > I checked again now definitely with both, sysconfig 1.11, rc 1.63 and > when I have the sh /etc/netstart in rc the hostname is not being set. > How should it ? I don't need to tell you that a sub shell does not inherit > variables that are set in the parent unless the subshell is 'sourced'. > > It works ok if I replace sh with . (source) (which was in some > earlier version of rc anyway). I don't like to repeat myself, but ``Hostname is set by /etc/sysconfig, /etc/sysconfig is sourced by /etc/rc''. I know all about sub shell vs sourced file and the effects on variables. I have been writting /etc/rc files for 15 years. Just where are you setting $hostname at? If your not doing it at about line 61 of /etc/sysconfig your not doing it the right way!!! You will note that at line 75 of /etc/rc the file /etc/sysconf is sourced into /etc/rc which means $hostname is defined. You will also note that this is the same way that /etc/netstart now gets this value from /etc/sysconfig. -- Rod Grimes rgrimes@gndrsh.aac.dev.com Accurate Automation Company Custom computers for FreeBSD