FS#50567 - [bash] Define NON_INTERACTIVE_LOGIN_SHELLS
Attached to Project:
Arch Linux
Opened by Marcos Mello (marcosfrm) - Monday, 29 August 2016, 13:39 GMT
Last edited by Jan Alexander Steffens (heftig) - Tuesday, 14 February 2017, 13:36 GMT
Opened by Marcos Mello (marcosfrm) - Monday, 29 August 2016, 13:39 GMT
Last edited by Jan Alexander Steffens (heftig) - Tuesday, 14 February 2017, 13:36 GMT
|
Details
I find pretty confusing when I log in text mode I get all my
custom settings from /etc/profile.d files and when I open
GNOME Terminal I do not.
Compiling bash with NON_INTERACTIVE_LOGIN_SHELLS defined appears to fix this behaviour[1]. However I do not have a strong background to know if the change can cause breakage in other components. [1] Fedora, Debian, openSUSE, define it. http://pkgs.fedoraproject.org/cgit/rpms/bash.git/tree/bash-2.03-profile.patch https://sources.debian.net/patches/bash/4.3-15/deb-bash-config.diff/ https://build.opensuse.org/package/view_file/openSUSE:Factory/bash/bash-4.3.dif?expand=1 |
This task depends upon
Closed by Jan Alexander Steffens (heftig)
Tuesday, 14 February 2017, 13:36 GMT
Reason for closing: Fixed
Additional comments about closing: bash 4.4.012-2
Tuesday, 14 February 2017, 13:36 GMT
Reason for closing: Fixed
Additional comments about closing: bash 4.4.012-2
It works in Fedora because ~/.bashrc sources /etc/bashrc, which then sources /etc/profile.d files if bash runs as a non-login shell.
https://git.fedorahosted.org/cgit/setup.git/tree/bashrc
this snippet
if ! shopt -q login_shell ; then
for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then
if [ "$PS1" ]; then
. "$i"
else
. "$i" >/dev/null
fi
fi
done
unset i
fi
and put it at the end of Arch's /etc/bash.bashrc. Works so far.
Aside from what should be, in practice arch packages seem to append $PATH in profile.d/*.sh unconditionally, so you would get n duplicate entries for the subshell at depth n.
What custom settings do you have in profile? Exported environment variables will propagate to subshells (including gnome terminal), other stuff could be moved to bashrc.
Just some aliases and proxy settings. I migrated them to bashrc.
For GNOME Terminal it is still an issue: https://bugs.archlinux.org/task/39684
Please close this bug. Thanks.
https://bugzilla.gnome.org/show_bug.cgi?id=736660#c110
It's enabled in both Debian and Fedora (both via a patch, not the environment).
Other shells (at least dash, zsh, fish, busybox ash) behave this way already, just our bash does not.