From owner-cvs-src@FreeBSD.ORG Sat Feb 10 20:52:30 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3976816A400; Sat, 10 Feb 2007 20:52:30 +0000 (UTC) (envelope-from ceri@submonkey.net) Received: from shrike.submonkey.net (cpc3-cdif2-0-0-cust64.cdif.cable.ntl.com [81.106.128.65]) by mx1.freebsd.org (Postfix) with ESMTP id E0EEA13C481; Sat, 10 Feb 2007 20:52:29 +0000 (UTC) (envelope-from ceri@submonkey.net) Received: from ceri by shrike.submonkey.net with local (Exim 4.66 (FreeBSD)) (envelope-from ) id 1HFzCu-000MoJ-Sp; Sat, 10 Feb 2007 20:52:28 +0000 Date: Sat, 10 Feb 2007 20:52:28 +0000 From: Ceri Davies To: Yar Tikhiy Message-ID: <20070210205228.GE9455@submonkey.net> References: <200702101313.l1ADDX8m056868@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+B+y8wtTXqdUj1xM" Content-Disposition: inline In-Reply-To: <200702101313.l1ADDX8m056868@repoman.freebsd.org> X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.13 (2006-08-11) Sender: Ceri Davies Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/etc/rc.d hostname X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Feb 2007 20:52:30 -0000 --+B+y8wtTXqdUj1xM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 10, 2007 at 01:13:33PM +0000, Yar Tikhiy wrote: > yar 2007-02-10 13:13:33 UTC >=20 > FreeBSD src repository >=20 > Modified files: > etc/rc.d hostname=20 > Log: > Handle the case when the admin forgot to set $hostname, > which can happen in new installations: advise to set the > variable and refer to rc.conf(5). Isn't it possible for the hostname to come via DHCP? How does this behave in that case (or rather, I can see how it behaves; is that the right thing)? > | @@ -58,7 +58,16 @@ hostname_start() > | fi > | fi > | =20 > | - /bin/hostname ${hostname} > | + # Have we got a hostname yet? > | + # > | + if [ -z "${hostname}" ]; then > | + warn "\$hostname is not set -- see ${rcvar_manpage}." > | + return > | + fi > | + > | + # All right, it is safe to invoke hostname(1) now. > | + # > | + /bin/hostname "${hostname}" > | echo "Setting hostname: `hostname`." Are the backticks necessary here? Why don't we use ${hostname}? Ceri --=20 That must be wonderful! I don't understand it at all. -- Moliere --+B+y8wtTXqdUj1xM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFFzjCMocfcwTS3JF8RArHYAJ0WBq9aPWPvpBGEMIIofEenpQ9z9QCfT41R lslhTUKQ6tKo+km8xMtiixM= =z+Sr -----END PGP SIGNATURE----- --+B+y8wtTXqdUj1xM--