[opensuse-factory] introduce /etc/bash.d/ for things that don't work in /etc/profile.d ?
Hello, two-line summary: I propose to create a /etc/bash.d/ directory for files that need to be read when starting a non-login shell (for example bash completion) longer version: You might have noticed that the bash-completion package didn't work since some time (bnc#764288). This was basically caused by a misunderstanding of how /etc/profile.d/ works. Files in /etc/profile.d/ are sourced for _login shells_ (in other words: whenever /etc/profile is read). That works fine for setting environment variables (which are exported to child processes, including shells), but breaks for things like bash completion because those aren't inherited to non-login shells. If you don't know the difference: su - $USER # will give you a login shell bash # will give you a non-login shell If you open a "normal" (non-login) shell, the files in /etc/profile.d/ are _not_ read. This means that various bash completions are not available. On my system, this at least affects gvfs-bash-completion.sh, osc.sh and polkit-bash-completion.sh. As a workaround, /etc/profile.d/bash_completion.sh is (now/again) sourced via /etc/bash.bashrc - but that breaks the advantage of having a *.d directory where you can just drop in a file and it is used. Therefore I propose to create a /etc/bash.d/ directory for files that need to be read when starting a non-login shell. I never used a different shell, therefore I have no idea if we'll need a /etc/tcsh.d/, /etc/ash.d/, /etc/zsh.d/, ... directory - feedback on this (and of course on the /etc/bash.d/ proposal) is welcome ;-) For bonus points, having a simple rpmlint check would also be nice: grep complete $BUILDROOT/etc/profile.d/ && \ echo "completion entries in /etc/profile.d/ won't work" Regards, Christian Boltz -- | Yes, I know. But there are even conjobs running as user games? Sometimes when cron is bored he starts playing games, didn't you know? ;-) [Aschwin Marsman and Robert Schiele opensuse] -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Christian Boltz wrote:
two-line summary: I propose to create a /etc/bash.d/ directory for files that need to be read when starting a non-login shell (for example bash completion)
Hijacking the thread ... unrelated to the problem itself I'd suggest to use a directory in /usr/share or /usr/lib instead. Those files are not really meant to be modified anyways, are they? We should try to get rid of such kind of files in /etc in the long term.
[...] For bonus points, having a simple rpmlint check would also be nice: grep complete $BUILDROOT/etc/profile.d/ && \ echo "completion entries in /etc/profile.d/ won't work"
That should be trivial. cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.de/ SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (2)
-
Christian Boltz
-
Ludwig Nussel