/etc/bash.d

Bug #1105645 reported by Alba Nader
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

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.

longer version:

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.

I propose to create a /etc/bash.d/ directory for files that need to be read when starting a non-login shell.

This adds the advantage of having a *.d directory where you can just drop in a file and it is used.

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 ;-)

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

bash (4.3-7ubuntu2) utopic; urgency=medium

  * Source profile.d from /etc/bash.bashrc to allow packages ship
    integration hooks into interactive shells, same ones they already ship
    for login shells. (Closes: #675008)
 -- Dimitri John Ledkov <email address hidden> Wed, 07 May 2014 12:12:04 +0100

Changed in bash (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.