Re: f26 chroot PATH doesn't include /bin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 17-08-31 14:43:10, Rick Stevens wrote:
On 08/31/2017 11:14 AM, Tony Nelson wrote:
> On 17-08-31 12:41:09, Mike Wright wrote:
>
>> How about using "env":  env PATH="new_path" chroot /some_dir
>>
>> Wouldn't this preempt the passed PATH, profile, bashrc, and the dot
>> files? If so, chroot could be defined as an alias to "env ... chroot"
>> and thereby eliminate the problem.
>
> Seems to work.  Note that this only changes the passed path; any
> pathmunge()'ing in the chroot's startup scripts still happens.  I've
> already fixed the problem inside the chroot, but I'll set this up if
> I find another problematic chroot.  It should be OK to look at
> /usr/bin twice if /bin -> /usr/bin and the command doesn't exist.

If the pathmunging is done in a "/<wherever-chroot-is>/etc/..." script
or in a "~/.whatever", absolutely as that is done after the chroot
spawns the shell in the chrooted environment. If you're saying it
happens before the chroot, then I don't know how that'd occur.

No, I didn't say that.  I said "I've already fixed the problem inside
the chroot".


I think the issue you've been having is that your chroot environment
doesn't have the merged /bin and /usr/bin. It has separate /bin and
/usr/bin directories. After the merge of /bin and /usr/bin was
established, I believe bash's built-in default PATH was modified to
assume this symlink was done. That's why the new bash doesn't have a
separate "/bin" in its default path.

bash's default path is not being used; if it were, it would be the
CentOS5 bash.  PATH is set in the chroot environment by chroot itself,
which is how the outer PATH or the env PATH get into it.  The f20 chroot
works because it postdates the /bin -> /usr/bin merge and doesn't need
/bin in PATH.  CentOS5 has separate /bin and /usr/bin, and needs /bin in
PATH.  That can be passed in, as with env, or done in the chroot by
pathmunge'ing in a bash startup script in /etc/profile.d (both
/etc/profile and /etc/bashrc source that directory).

--
____________________________________________________________________
TonyN.:'                       <mailto:tonynelson@xxxxxxxxxxxxxxxxx>
      '                              <http://www.georgeanelson.com/>
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux