I tend to copy some useful programs to every server I login to. I have loads of configuration files, a statically compiled zsh (in case I need a new version), vim, python, version control binary, etc. I have a script that just checks them out, links all binaries to ~/bin if they're newer than the system-wide versions, and does all the needed setup - I've got the setup I need on any kind of host/distro.
This has worked just fine, while I had the same login on all hosts. Unfortunately now I can't use my standard login at some hosts. How can I modify my environment to work in the same way without recompiling? For example with a normal deployment, I would need to recompile python to make /home/yyy/priv_env/python/lib
the main library path, but on all other hosts I need /home/xxx/...
. This case can be solved with PYTHONPATH
of course, but there are other binaries taking the default path from the compilation stage - like zsh modules. Is there any way to solve this without taking care of many shell variables?
Ideally, I would use a private chroot in the environment which maps to all the needed directories to the places I need. But chroot is not available for non-root users of course.
I also thought about setting up a link in /tmp/${random_preselected_string}
to ${HOME}/priv_env
and setting all the paths to point at the /tmp/...
link. This will work as long as noone creates a file with the same name there. Also with long login sessions, it might be affected by tmp autocleaners.
Have you got any better ideas?