From owner-freebsd-mobile@FreeBSD.ORG Sun Jun 26 18:10:24 2011 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F60B106564A for ; Sun, 26 Jun 2011 18:10:24 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id CB7AD8FC18 for ; Sun, 26 Jun 2011 18:10:23 +0000 (UTC) Received: by gwb15 with SMTP id 15so2182556gwb.13 for ; Sun, 26 Jun 2011 11:10:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=IFVWUdVDP5p6G+qcvQRMImvRUuvuXEsC95TIXs/fHDI=; b=CiaQWEzu/WzS2InI2se3yr04xQEi1mPrevqzrdP/HGLCgzOSh8F1jEq0P+6Otj60uh wfBS3uUZ1d1lyJ1Ovp3TwhBYtiBvpWoNqaIl0SG4zHiRlRRbDUYaddit6TDX2aiQVzzv nsMDcyAI//4zvjG11Ec9apUkye3bX/erIsxAs= 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=SptR7gpjjxepoxzQ+VSkyryawS4jYdYeJMKpZLy/pqUSf8Cttr7twLi89pXynd/61u +Pb4nXJKuUrcy3SwbDfx2B+BrgA/eRbYpFN47qQV++HonvdYSYdwoazc0QsVyK+AmZ25 PobeAfNBe3iGWTC2ZQHsTAtN0VCUDO7gQCj1c= MIME-Version: 1.0 Received: by 10.150.73.26 with SMTP id v26mr4173507yba.59.1309111822775; Sun, 26 Jun 2011 11:10:22 -0700 (PDT) Received: by 10.150.12.15 with HTTP; Sun, 26 Jun 2011 11:10:21 -0700 (PDT) In-Reply-To: <20110626115527.GA86487@psconsult.nl> References: <20110626115527.GA86487@psconsult.nl> Date: Sun, 26 Jun 2011 08:10:21 -1000 Message-ID: From: Kevin Oberman To: Paul Schenkeveld Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, freebsd-mobile@freebsd.org Subject: Re: Automatic per-site configuration X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 18:10:24 -0000 On Sun, Jun 26, 2011 at 1:55 AM, Paul Schenkeveld wr= ote: > Hi, > > There must be many others like me who carry a laptop from one site to > another every week. =A0Currently I have to work at four different sites. > > I'd like my FreeBSD 8.2 laptop to automatically start stuff depending > on where I boot it and also my personal login environment depends on > where I am (PRINTER setting in .profile, clients to automatically start > and DISPLAY setting in .xsession, key bindings in .ctwmrc etc.) > > Until recently I could look at the fully qualified hostname I got from > DHCP as all DHCP servers gave me a usable hostname but now I also have > to work at various sites where DHCP does not give me a hostname at all. > > Getting no hostname from DHCP confuses xdm which defaults to "1" > requiring me to switch to another virtual console and manually set the > hostname to "localhost" or something. > > The hostname=3D"foo.bar.tld" in rc.conf is absolute, when set the hostnam= e > obtained from DHCP is ignored. > > How do other people solve this? =A0I'd prefer to to be prompted during > boot and during login for the site I want to configure for. I have been using Tobias Roth's profile to do this for several years. It is an RC script that runs right after mountcritical and checks for known networks via several techniques. It then does a unionfs mount of a file-backed md on /etc. It contains t least a locations specific rc.conf.local and my contain whatever other files in /etc which you might want per-site, such as resolv.conf or wpa_supplicant.conf. While it has worked (with a two line tweak to /etc/rc.subr to rollback the for support for special processing of rc.d files with a .sh extension), several developers expressed concerns with its viability and I don't think Tobias has done anything with it for some time. I'm not even sure that it is still available. If it is not, I could probably make it, along with the trivial patch to /etc/rc.subr available. For a tool that supposedly would suffer from long-term viability, I have been using it for FreeBSD 5 through 8. I suspect it will work fine in 9, when I get around to trying it. --=20 R. Kevin Oberman, Network Engineer - Retired E-mail: kob6558@gmail.com