From owner-freebsd-rc@FreeBSD.ORG Thu Nov 18 23:28:44 2010 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13A35106566C for ; Thu, 18 Nov 2010 23:28:44 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9EF238FC0C for ; Thu, 18 Nov 2010 23:28:43 +0000 (UTC) Received: by wyb35 with SMTP id 35so3002880wyb.13 for ; Thu, 18 Nov 2010 15:28:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=/kY4VX/Llr8TcBzr3cN82/TeIXoCbMgPvVyISH0kOd0=; b=rkL6rfD03FNcYUpjhhELo1e/drD8nIgqCj6kFGygC0FpAuMKcjOJJ4X5h5QMoB+DDg DTaq2di9C4sS3XNJM/AHfUWzwOP96QYnlskZ+YAk0t68lAFoW+wOO2jEDm5e/H47L2aS AkO2FZ1aah4KUvykFg0/oqmt+EgxROSxreaAY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=J2aHKoUGLiBKg5mCyyDheCBr5vBFjGsgn7H6CkNM5H6epFHFIfpP/FvKXGYOghnUmX 9xkupXMBDGonH6Pp+N4NlfFL6Eq6MWT5k7HX6OLZ4ViiVBMrcHMmhn1X+SA4Hw8AO1re oGVtUd1OHtQdTzYto+fDXVO3HNqYvGCk4gkS4= MIME-Version: 1.0 Received: by 10.216.7.210 with SMTP id 60mr172307wep.30.1290122922032; Thu, 18 Nov 2010 15:28:42 -0800 (PST) Received: by 10.216.198.27 with HTTP; Thu, 18 Nov 2010 15:28:41 -0800 (PST) In-Reply-To: <20101118224727.GB95648@stack.nl> References: <20101118224727.GB95648@stack.nl> Date: Thu, 18 Nov 2010 15:28:41 -0800 Message-ID: From: Garrett Cooper To: Jilles Tjoelker Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: rc@freebsd.org Subject: Re: rc.d/hostname dependency on netif backwards? X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 23:28:44 -0000 On Thu, Nov 18, 2010 at 2:47 PM, Jilles Tjoelker wrote: > On Mon, Nov 15, 2010 at 07:27:32PM -0800, Garrett Cooper wrote: >> =A0 =A0 It looks like existing code for rc.d/hostname might be backwards= : > >> %/etc/rc.d/hostname restart >> + /sbin/sysctl -n security.jail.jailed >> + [ 0 -eq 1 ] >> + /bin/hostname -s >> + hostname_s=3D2(SERVFAIL) >> + [ -n 2(SERVFAIL) ] >> + return >> + _return=3D0 >> + [ 0 -ne 0 ] >> + return 0 >> + _run_rc_postcmd >> + [ -n =A0] >> + return 0 >> + return 0 >> %sysctl -a | grep hostname >> kern.hostname: 2(SERVFAIL) >> security.jail.set_hostname_allowed: 1 > >> =A0 =A0 Why is it trying to resolve a hostname (hostname -s) before the >> network's up? I could understand if this was a statically defined >> hostname, but all of my hostnames are derived from pxebooting ala >> dhcpd / named, not a static value :). > > /bin/hostname is just a wrapper around gethostname()/sethostname(). It > does not use DNS (some versions of GNU hostname do). Sure. > You should try to find what is setting the hostname to 2(SERVFAIL). A This is actually a gai_strerror. > cause could be not checking host(1)'s exit status -- it prints any error > message to stdout. Yeah... that's a bit annoying -- it should go to stderr. > Neither /etc/rc.d/hostname nor /sbin/dhclient-script appear to do anythin= g like that. Yeah... it's kind of weird. On the bright side it doesn't happen with (relatively) vanilla CURRENT. I'm not sure what IronPort changes have been made to our FreeBSD 7.1 image that might have broken this (if 7.1 didn't work already this way), but I'm not going to concern myself too much about it now. The workaround is trivial... Thanks, -Garrett