Date: Thu, 11 May 1995 10:25:39 -0700 (PDT) From: "Rodney W. Grimes" <rgrimes@gndrsh.aac.dev.com> To: kuku@gilberto.physik.rwth-aachen.de Cc: freebsd-current@freefall.cdrom.com Subject: Re: bug in /usr/src/etc/rc (netstart) Message-ID: <199505111725.KAA10530@gndrsh.aac.dev.com> In-Reply-To: <199505110624.IAA15370@gilberto.physik.rwth-aachen.de> from "Christoph Kukulies" at May 11, 95 08:24:33 am
next in thread | previous in thread | raw e-mail | index | archive | help
> > > > > > > > > > > > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199505111725.KAA10530>