Re: [arch-general] How to safe configs to another path than ~
-------- Cancelled posting -------- On Thu, 2013-07-25 at 18:46 +1000, Gaetan Bisson wrote: > Applications have different means of finding out what the HOME directory > of a given user is. The HOME environment variable is just one of them. > Other popular ones include the function calls getpwuid() and getpwuid(); > they basically read the data from /etc/passwd so your only way to work > around that and pretend having a different home directory would be to > override those calls with LD_PRELOAD... Thank you Gaetan, but this fails too: $ LD_PRELOAD=/home/rocketmouse/alt_profiles/1/ /usr/bin/xfce4-terminal ERROR: ld.so: object '/home/rocketmouse/alt_profiles/1/' from LD_PRELOAD cannot be preloaded: ignored. Regards, Ralf -------- End of cancelled posting -------- Assumed I would be able to do it, then I need to write new calls that will replace those calls?
On 25.07.2013 11:33, Ralf Mardorf wrote:
-------- Cancelled posting -------- On Thu, 2013-07-25 at 18:46 +1000, Gaetan Bisson wrote: > Applications have different means of finding out what the HOME directory > of a given user is. The HOME environment variable is just one of them. > Other popular ones include the function calls getpwuid() and getpwuid(); > they basically read the data from /etc/passwd so your only way to work > around that and pretend having a different home directory would be to > override those calls with LD_PRELOAD...
Thank you Gaetan,
but this fails too:
$ LD_PRELOAD=/home/rocketmouse/alt_profiles/1/ /usr/bin/xfce4-terminal ERROR: ld.so: object '/home/rocketmouse/alt_profiles/1/' from LD_PRELOAD cannot be preloaded: ignored.
Regards, Ralf -------- End of cancelled posting --------
Assumed I would be able to do it, then I need to write new calls that will replace those calls?
Maybe my suggestion produces some major drawbacks that I don't recognize at the moment, but couldn't you just use symlinks for the conf files & dirs and change those symlinks' targets via scripts if you want to use a different configuration? Or make /home/yourusername a symlink to the home directory you want to use at the moment?
On Thu, Jul 25, 2013 at 10:19 AM, Jörg Tobias Borgert <mail@tobias-borgert.de> wrote:
On 25.07.2013 11:33, Ralf Mardorf wrote:
-------- Cancelled posting -------- On Thu, 2013-07-25 at 18:46 +1000, Gaetan Bisson wrote: > Applications have different means of finding out what the HOME directory > of a given user is. The HOME environment variable is just one of them. > Other popular ones include the function calls getpwuid() and getpwuid(); > they basically read the data from /etc/passwd so your only way to work > around that and pretend having a different home directory would be to > override those calls with LD_PRELOAD...
Thank you Gaetan,
but this fails too:
$ LD_PRELOAD=/home/rocketmouse/alt_profiles/1/ /usr/bin/xfce4-terminal ERROR: ld.so: object '/home/rocketmouse/alt_profiles/1/' from LD_PRELOAD cannot be preloaded: ignored.
Regards, Ralf -------- End of cancelled posting --------
Assumed I would be able to do it, then I need to write new calls that will replace those calls?
Maybe my suggestion produces some major drawbacks that I don't recognize at the moment, but couldn't you just use symlinks for the conf files & dirs and change those symlinks' targets via scripts if you want to use a different configuration? Or make /home/yourusername a symlink to the home directory you want to use at the moment? Even better, you could have an intermediary directory symlink that you could swap out easily without the overhead of writing scripts to do what you want. For example if you wanted to work with .zshrc you would symlink ~/.zshrc to ~/intermediary/.zshrc, but ~/intermediary would also be a symlink to wherever your profile was really stored. Then you could just recreate ~/intermediary pointing to a different profile whenever you wanted to swap.
On Thu, Jul 25, 2013 at 3:33 AM, Ralf Mardorf <ralf.mardorf@alice-dsl.net> wrote:
-------- Cancelled posting -------- On Thu, 2013-07-25 at 18:46 +1000, Gaetan Bisson wrote: > Applications have different means of finding out what the HOME directory > of a given user is. The HOME environment variable is just one of them. > Other popular ones include the function calls getpwuid() and getpwuid(); > they basically read the data from /etc/passwd so your only way to work > around that and pretend having a different home directory would be to > override those calls with LD_PRELOAD...
Thank you Gaetan,
but this fails too:
$ LD_PRELOAD=/home/rocketmouse/alt_profiles/1/ /usr/bin/xfce4-terminal ERROR: ld.so: object '/home/rocketmouse/alt_profiles/1/' from LD_PRELOAD cannot be preloaded: ignored.
Regards, Ralf -------- End of cancelled posting --------
Assumed I would be able to do it, then I need to write new calls that will replace those calls?
How about sudoing to different users?
On Thu, 2013-07-25 at 15:52 -0600, Chris Moline wrote:
How about sudoing to different users?
That is what I already do, but I can't have a new user for each audio production. A very old script I'm using for a very long time: xhost + gksudo -u chuser "$*" xhost - exit A way to get configs to /music/production_0001, /music/production_0002 ... /music/production_9999 is what I need. I think about the other ideas given by the list. Thank you.
On Thu, Jul 25, 2013 at 10:35 PM, Ralf Mardorf <ralf.mardorf@alice-dsl.net> wrote:
A very old script I'm using for a very long time:
xhost + gksudo -u chuser "$*" xhost - exit
A way to get configs to /music/production_0001, /music/production_0002 ... /music/production_9999 is what I need.
I'm wondering what apps specifically do you use? I think we can help you better if we know what those are.
On Fri, 2013-07-26 at 03:28 -0600, Chris Moline wrote:
A way to get configs
to /music/production_0001, /music/production_0002 ... /music/production_9999
is what I need.
I'm wondering what apps specifically do you use? I think we can help you better if we know what those are.
For example Qtractor, but I don't have a list of apps I'm using, I want be able to handle the app that will be written tomorrow too. For Qtractor it's easy to find the configuration in /home/rocketmouse/.config/rncbc.org/, so I could copy and restore it, but I hope there's a better way, than to do it like this. HOME=/path/foo app might work for some apps.
On Fri, Jul 26, 2013 at 4:03 AM, Ralf Mardorf <ralf.mardorf@alice-dsl.net> wrote:
On Fri, 2013-07-26 at 03:28 -0600, Chris Moline wrote:
A way to get configs
to /music/production_0001, /music/production_0002 ... /music/production_9999
is what I need.
I know you didn't like the sudo idea but I thought I'd ask anyway. Are you limited in the number of users you can create? What if you had two users, one for normal usage, browsing and such, another for audio work. If you take care to use your audio apps as the audio user it should be easy to find the configs. Even if you end up going back to just one user account this will help you to locate where the configs are.
On Fri, Jul 26, 2013 at 7:40 AM, Chris Moline <blackredtree@gmail.com> wrote:
On Fri, Jul 26, 2013 at 4:03 AM, Ralf Mardorf <ralf.mardorf@alice-dsl.net> wrote:
On Fri, 2013-07-26 at 03:28 -0600, Chris Moline wrote:
A way to get configs
to /music/production_0001, /music/production_0002 ... /music/production_9999
is what I need.
I know you didn't like the sudo idea but I thought I'd ask anyway.
Are you limited in the number of users you can create? What if you had two users, one for normal usage, browsing and such, another for audio work. If you take care to use your audio apps as the audio user it should be easy to find the configs. Even if you end up going back to just one user account this will help you to locate where the configs are.
How about chroot? Make a profile directory and then symlink to your directories. It'd be a pain in the ass to setup the first time but after that it's make a new profile dir and copy the chroot stuff over.
If your apps all follow XDG specifications you could set $XDG_CONFIG_HOME to cause them to put their configuration elsewhere. Regards, ~Celti On Fri, Jul 26, 2013 at 3:03 AM, Ralf Mardorf <ralf.mardorf@alice-dsl.net> wrote:
On Fri, 2013-07-26 at 03:28 -0600, Chris Moline wrote:
A way to get configs
to /music/production_0001, /music/production_0002 ... /music/production_9999
is what I need.
I'm wondering what apps specifically do you use? I think we can help you better if we know what those are.
For example Qtractor, but I don't have a list of apps I'm using, I want be able to handle the app that will be written tomorrow too.
For Qtractor it's easy to find the configuration in /home/rocketmouse/.config/rncbc.org/, so I could copy and restore it, but I hope there's a better way, than to do it like this. HOME=/path/foo app might work for some apps.
Op 26 jul. 2013 13:22 schreef "Ralf Mardorf" <ralf.mardorf@alice-dsl.net> het volgende:
On Fri, 2013-07-26 at 03:28 -0600, Chris Moline wrote:
A way to get configs
to /music/production_0001, /music/production_0002 ...
/music/production_9999
is what I need.
I'm wondering what apps specifically do you use? I think we can help you better if we know what those are.
For example Qtractor, but I don't have a list of apps I'm using, I want be able to handle the app that will be written tomorrow too.
For Qtractor it's easy to find the configuration in /home/rocketmouse/.config/rncbc.org/, so I could copy and restore it, but I hope there's a better way, than to do it like this. HOME=/path/foo app might work for some apps.
I think someone else said the same, but i really think you should consider a version system like git. A real configuration system like cfengine could also work, but might be a bit overkill for this situation. The cleanest would be if the apps run under a dedicated user account, so that you can clear everything without worrying about losing stuff. When this is setup, all you have to do is create the necessary configurations and add (and tag) those to your repository. Then, for every new production, clear the homedir, checkout the right config-set and do your thing. If necessary, you could do this on an application-by-application base, though that could get messy soon... Hope that helps. Mvg, Guus
participants (6)
-
Alex Jordan
-
Chris Moline
-
Guus Snijders
-
Jörg Tobias Borgert
-
Patrick Burroughs (Celti)
-
Ralf Mardorf