strang1ato / nhi

:tv: Automatically capture all potentially useful information about each executed command (as well as its output) and get powerful querying mechanism
GNU General Public License v3.0
295 stars 11 forks source link

Update bash package in default-bash-and-zsh ppa with /etc/bash.bashrc support #22

Open clarkead opened 9 months ago

clarkead commented 9 months ago

On Ubuntu, while using nhi after following the install procedures outlined in the README.md, I noticed that my system-wide /etc/bash.bashrc was not getting sourced into my interactive shells (it still worked with login shells as /etc/profile loads the /etc/bash.bashrc). After digging into the issue, it seems like the issue starts after reinstalling the bash package from ppa:strang1ato/default-bash-and-zsh. After some Googling it looks like the issue might be due to a missing option (-DSYS_BASHRC) when bash is being compiled.

Simplified steps to reproduce on a clean Ubuntu 22.04 instance...

# ssh to the instance

sudo apt update
sudo apt upgrade
sudo bash -c 'echo "echo \"Hit: /etc/bash.bashrc\"" >> /etc/bash.bashrc'
echo "echo \"Hit: ~/.bashrc\"" >> ~/.bashrc

# exit and ssh back in to the instance, note you get two echos

bash

# note you get two echos

# next we will exit the interactive shell and go back to the login shell from ssh
exit

sudo apt remove zsh-common
sudo add-apt-repository ppa:strang1ato/default-bash-and-zsh
sudo apt update
sudo apt install --reinstall bash

# exit and ssh back in to the instance, note you get two echos

bash

# note you only get one echo

Thank you for this project and work!

strang1ato commented 9 months ago

Thank you for comprehensive report of the issue!