Get into chroot and ensure Bash is behaving as it was
How to get into chroot while keep Bash behavior settings, and important tools else, fully working intact ?
|
|
Quote:
What are you trying to use chroot for? What is it that causes your concern? |
/etc
contains many shell poisons. avoid them all! also your ~/home/name. your chroot has to specify home director for user in /etc/passwords and it must have any .bashrc in the $HOME for chroot you may need to do this: (chroot -i should do it?) # . /etc/profile your system profile should NOT have even a single false statement and have 0 i mean no text output - or bash will choke and login won't be normal or even fail. The same goes for X11 startup - a fact documented (in the past) pretty good. that will do it. assuming your chroot supports TTY color like the parent does and is basically compatible with the running kernel. (i assume it does) # . /etc/profile depends on your shell. chroot executes bash(1) but may not be "interactive". (you can hack if it is in /etc/profile but don't make any mistake like "making it interactive when it shouldn't be" !!!) (for older linux not hacked ubuntu!) WHEN getty(1) activates login(1) activates bash interactive. DO NOT TRY LOGIN IN THE CHROOT unless you know what your doing. You'll be booted out freeze your pc maybe :) So there you go. Bash runs ". /etc/profile" (if it exists) and if interactive. but don't hack "always interactive" you'll mess things up. perhaps recompile chroot to have a -I interactive option. I know: have a different BASH which is always interactive, and do # cd /bin ; ln -sf bash_I sh then chroot is always interactive (this assumes you have a bash binary that by name knows it's interactive - but idk if it does that) or hack chroot to support an -I option |
All times are GMT -5. The time now is 10:12 PM. |