LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   dchroot environment variables not consistent (https://www.linuxquestions.org/questions/linux-software-2/dchroot-environment-variables-not-consistent-863826/)

spikeygg 02-20-2011 12:00 AM

dchroot environment variables not consistent
 
So, I've created a 32-bit chroot on my AMD64 installation. It works pretty well when I just type 'dchroot' but if I try to execute a 32-bit program from 64-bit land using 'dchroot <command>', the environment variables are all screwed up. I know I can use -d or --preserve-environment to keep my 64-bit environment but I don't want to do that because I want my PATH to change when I go into 32-bit land. Here's an example of what I am talking about:

Code:

me@box:~$ dchroot "echo \$PATH"
I: [x86 chroot] Running command: “echo $PATH”
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
me@box:~$ dchroot -d "echo \$PATH"
I: [x86 chroot] Running command: “echo $PATH”
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/mythtv/scripts:/mythtv/mythtv_binaries/bin
me@box:~$ dchroot
(32bit)me@box:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/mythtv/scripts:/mythtv/mythtv_binaries_32bit/bin
(32bit)me@box:~$

I have looked through my entire /etc directory (on both 64 and 32-bit installations) looking for where the $PATH is getting set to /usr/bin/X11 and I can't find it anywhere!! WTH? HELP!

Thanks,
-Greg

corp769 02-20-2011 04:57 PM

Have you tried looking for /etc/env.d* ? (wildcard for anything containing env.d and/or env)

spikeygg 10-22-2011 12:39 PM

Quote:

Originally Posted by corp769 (Post 4265175)
Have you tried looking for /etc/env.d* ? (wildcard for anything containing env.d and/or env)

No dice.

Code:

(32bit)me@box:/etc$ ls env*
environment
(32bit)me@box:/etc$ cat environment
(32bit)me@box:/etc$

There is just an environment file in there with nothing in it. :(


All times are GMT -5. The time now is 07:15 PM.