[clug] Local configuration on a non-homogeneous LAN

Brenton Ross rossb at fwi.net.au
Wed Jul 3 00:29:04 UTC 2019


Thanks to those that provided some comments.
OK, I have a solution, but it isn't pretty. It looks like it will be
OKfor my scenario, but it is hardly a universal solution.
The basis is a script that runs in the /etc/profile.d directory as
theuser logs in. This moves the .config and .local directories into
adirectory called $HOME/.sweepings/$HOSTNAME. It then creates soft
linkscalled .config and .local that reference another pair of soft
links in/run/user/$UID/sweepings called .config and .local which point
to theoriginal directories $HOME/.sweepings/$HOSTNAME/.config and
similarlyfor .local.
The double redirection means that no matter which machine you arelogged
into the exact same soft link ends up pointing to theconfiguration data
for the specific machine.
[The script sweeps up the rubbish dumped on the floor of my
homedirectory - hence the name.]
For now I am only doing this for .config and .local, but it can
easilybe extended to other directories and files if they prove to be
aproblem.
The second, and ugly, part is handling the initial log in
scenario.Desktops will generally run a whole heap of scripts and things
to setup the desktop environment when a user first logs into a machine.
Someof them appear to get mightily confused if they find the user's
homedirectory already has stuff in it.
My solution is to mount a small empty file system over the
homedirectory while the user logs in. After they are set up they log
outand the contents of the small file system are copied into their
realhome directory.
Since mounting requires root privileges this cannot be part of
thescript in /etc/profile.d and has to be done by an administrator.
Thetiming also makes it impossible - it would have to be launched by
thelogin process before it switched to the user.
I will now live with this for a while and see how it goes in real use.
Cheers Brenton

On Tue, 2019-06-25 at 14:24 +1000, steve jenkin wrote:
On 22 Jun 2019, at 13:38, Brenton Ross via linux <linux at lists.samba.org
> wrote:
My thinking at the moment (after sleeping on the problem) is
usesomesoft links, one of which would be in /run (or somewhere
similar)andwould be set by the login script and point to the VM
specificconfigdirectory for the user. I will try to set this up and let
you knowhowit goes.
Brenton,
Good solution.Easy to put into a .bashrc file [discern uname, link
correctenvironment, even Home dir.]Will always work if you check the
target of the symlink exists and isreadable :)
The Plan 9 people created a similar problem with their “support
manyCPU’s” goal, implying 10 or more different libraries of
executables.They solved it using “overlay mounts” (aka transparent
mounts.Different to loopback mounts).
Hence /bin was all you needed.It was the entire path, because during
login the setup mounted allthe machine/CPU specific binaries etc etc
onto “/bin”.They moved search directories of PATH’s to searching
overlay mounts -exactly the same problem, amenable to hashing.
I’m also partly recollecting some research system that wasdistributed
but with local home directories.Probably ‘Andrew’ - they had their own
File System too.
Meaning:	this is a problem others have attempted to solve
before, and	it’s subtle and hard :(
Hope you’ve got it nailed and have moved on.
All my beststeve
--Steve Jenkin, IT Systems and Design 0412 786 915 (+61 412 786 915)PO
Box 38, Kippax ACT 2615, AUSTRALIA
stevej098 at gmail.comhttp://members.tip.net.au/~sjenkin



More information about the linux mailing list