[arch-general] chsh, linux32 and $PATH
I am trying to seamlessly run an x86_64 kernel on my i686 machine. I have enough aliases that most things work right (prefixing with linux32), but bash can not handle setting e.g. "./configure" as an alias and there is always something I have missed. So, I came up with a cunning plan... Create a script /bin/bash32 which just runs "linux32 /bin/bash", then add /bin/bash32 to /etc/shells and run "chsh -s /bin/bash32". It works in a way... when I run uname, it tells me I am using the i686 kernel. Success! Now the bad part... my $PATH gets reduced to: /home/allan/bin:/bin:/usr/bin The /home/allan/bin part tells me that my ~/.bashrc is being sourced, as does my prompt and all my aliases. So something else is being missed. The /bin:/usr/bin is the minimum path defined in /etc/login.defs. All the rest is in /etc/profile and the various /etc/profile.d scripts. Why are they not being sourced... Or are they being sourced and then I open up a new shell with my script which gets rid of them? Allan
On Sun, Jan 24, 2010 at 7:49 PM, Allan McRae <allan@archlinux.org> wrote:
I am trying to seamlessly run an x86_64 kernel on my i686 machine. I have enough aliases that most things work right (prefixing with linux32), but bash can not handle setting e.g. "./configure" as an alias and there is always something I have missed.
So, I came up with a cunning plan... Create a script /bin/bash32 which just runs "linux32 /bin/bash", then add /bin/bash32 to /etc/shells and run "chsh -s /bin/bash32".
It works in a way... when I run uname, it tells me I am using the i686 kernel. Success! Now the bad part... my $PATH gets reduced to:
/home/allan/bin:/bin:/usr/bin
The /home/allan/bin part tells me that my ~/.bashrc is being sourced, as does my prompt and all my aliases. So something else is being missed. The /bin:/usr/bin is the minimum path defined in /etc/login.defs.
All the rest is in /etc/profile and the various /etc/profile.d scripts. Why are they not being sourced... Or are they being sourced and then I open up a new shell with my script which gets rid of them?
You probably want a login shell, e.g. /bin/bash -l
2010/1/24 Dan McGee <dpmcgee@gmail.com>:
You probably want a login shell, e.g. /bin/bash -l
I'd go with (untested): #!/bin/sh exec linux32 /bin/bash "$@" -- Tavian Barnes
On 25/01/10 12:23, Tavian Barnes wrote:
2010/1/24 Dan McGee<dpmcgee@gmail.com>:
You probably want a login shell, e.g. /bin/bash -l
Thanks. That fixed the PATH issue I was having but it turns out that was not my real issue... see below
I'd go with (untested):
#!/bin/sh exec linux32 /bin/bash "$@"
This fixes my real issue but then the issue with my path remains. When I use "/bin/bash -l", I can not login to XFCE using slim. Via startx or startxfce4 is file. Using "$@", fixes that but I still have the issue with the $PATH not being set. It turns out there is this in /etc/slim.conf login_cmd exec /bin/bash -login ~/.xinitrc %session Without changing that line, I get this in my slim log: error setting MTRR (base = 0xd0000000, size = 0x10000000, type = 1) Inappropriate ioctl for device (25) changing that to have either "/bin/bash32" or "linux32 /bin/bash" does not work as it appears slim runs something like: /bin/bash /bin/bash32 -c <config line> to actually launch the session. GDM works but 65MB for a login manager seems a bit much. So close... Allan
On 25/01/10 13:53, Allan McRae wrote:
On 25/01/10 12:23, Tavian Barnes wrote:
2010/1/24 Dan McGee<dpmcgee@gmail.com>:
You probably want a login shell, e.g. /bin/bash -l
Thanks. That fixed the PATH issue I was having but it turns out that was not my real issue... see below
I'd go with (untested):
#!/bin/sh exec linux32 /bin/bash "$@"
This fixes my real issue but then the issue with my path remains.
<snip>
Both fix something so why did I not try the combination... This works: #!/bin/bash exec linux32 /bin/bash -l "$@ Allan
participants (3)
-
Allan McRae
-
Dan McGee
-
Tavian Barnes