Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jun 2011 08:10:21 -1000
From:      Kevin Oberman <kob6558@gmail.com>
To:        Paul Schenkeveld <freebsd@psconsult.nl>
Cc:        freebsd-hackers@freebsd.org, freebsd-mobile@freebsd.org
Subject:   Re: Automatic per-site configuration
Message-ID:  <BANLkTimzrXMT7jUtTXEm0h7R5FGoMMb1VQ@mail.gmail.com>
In-Reply-To: <20110626115527.GA86487@psconsult.nl>
References:  <20110626115527.GA86487@psconsult.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jun 26, 2011 at 1:55 AM, Paul Schenkeveld <freebsd@psconsult.nl> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTimzrXMT7jUtTXEm0h7R5FGoMMb1VQ>