You are not logged in.

#1 2012-09-13 02:17:21

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Install Instructions or pacstrap is missing /root/.bash_profile

After migrating my Arch from an older laptop to a newer one, I noticed that I could not get my "su -" root-terminal to automatically take on Bash coloring. After digging around, I found out that this is because the /root/.bash_profile file is missing for root. According to https://wiki.archlinux.org/index.php/Bash, in the "But, in Arch, by default:" section, it says:

"which means that /etc/bash.bashrc and ~/.bashrc will be executed for all interactive shells, whether they are login shells or not."

But, of course, for the root user, this is only true if you have copied /etc/skel/.bash_profile to /root/.bash_profile.

To save other, possibly new, Archers the search, should we add this step to either pacstrap (assuming that this is what creates the initial /root folder), or at least add an instruction to copy it from /etc/skel to the installation instructions?

Offline

#2 2012-09-13 02:32:26

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,137

Re: Install Instructions or pacstrap is missing /root/.bash_profile

It should read /etc/profile in that case which by default sources /etc/bash.bashrc. At least, according to bash's man page. That is, it should work even if those files are not in /root.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2012-09-13 02:41:31

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: Install Instructions or pacstrap is missing /root/.bash_profile

cfr wrote:

It should read /etc/profile in that case which by default sources /etc/bash.bashrc. At least, according to bash's man page. That is, it should work even if those files are not in /root.

Not sure what you mean by "it", but what I found is that the Wiki is, in fact, correct, it says:

* if interactive + login shell → /etc/profile then the first readable of ~/.bash_profile, ~/.bash_login, and ~/.profile
...

But, in Arch, by default:
* /etc/profile (indirectly) sources /etc/bash.bashrc
* /etc/skel/.bash_profile which users are encouraged to copy to ~/.bash_profile, sources ~/.bashrc

Now, /etc/bash.bashrc does NOT source ~/.bashrc, but it does source ~/.bash_profile, so the only way to pull in ~/.bashrc is to have an copy of /etc/skel/bash_profile as ~/.bash_profile, which sources ~/.bashrc.

I noticed that this is only an issue for /root. Any regular user will get the ~/.bash_profile copied from /etc/skel.

Offline

Board footer

Powered by FluxBB