Re: f26 chroot PATH doesn't include /bin

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

 



On 17-08-31 12:18:38, Tom H wrote:
On Wed, Aug 30, 2017 at 3:16 PM, Tony Nelson
<tonynelson@xxxxxxxxxxxxxxxxx> wrote:
>
> I have an old CentOS5 that I chroot into. On my old f20 box, PATH
> included /bin, but now on f26 it does not. I don't understand how
> this could happen; I would think that PATH is set inside the chroot
> by the shell. How does PATH get set? I see how it is modified and
> have fixed my issue, provided I use a login shell.

It's because chroot keeps PATH set. So if your pre-chroot PATH doesn't
include "/sbin" or "/bin", they won't be in the chrooted PATH:

OK, now I get it.  I have another chroot for f20, which is after the
/bin -> /usr/bin transition, that works because it doesn't need any help.

 ...
If you use a login shell (eg, "chroot /bb bash -l" instead of "chroot
/bb bash"), the dotfiles that will be sourced will set the appropriate
chrooted PATH.

Sadly, no, not without editing them.  The only pathmunge()'ing I see is
for root's use of sbin.  I added a file to /etc/profile.d to pathmunge
/bin, which sets the path for both interactive and login shells.

I still have an issue of no saved history on plain interactive shells,
so I do specify a login shell.  My f20 chroot doesn't have the problem,
either as a login shell or not as shown by `shopt login_shell`, but
it's a more complicated (overlayfs over ro mount) setup, as well as
newer than the CentOS5 setup.

The history issue with CentOS5 chroot is new with f26, and worked in
f20.

--
____________________________________________________________________
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