mainThe GNU Bourne-Again SHell - Support: sr #108737, bash initialization, in...

 
 

sr #108737: bash initialization, in unconditional mode at system level

Submitter:  None
Submitted:  Sat 31 Jan 2015 03:12:47 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  4 - Important Status:  Wont Do
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 25 Mar 2015 09:43:00 AM UTC, comment #1: 

The referenced patch has more to do with rejecting the distro provided bashrc, and not really to provide a unified rcfile.

The issue is solved easily, and you don't really have to patch bash, you just need to:

- Provide users with template .bashrc/.profile files.
- Said template files should do the following: .profile sources .bashrc if bash is detected. .bashrc setups the shell and possibly sources global rcfiles that you determine convenient.

So, that'd look like this:

$ cat ~/.profile
if [[ $BASH_VERSION && -r $HOME/.bashrc ]]; then . ~/.bashrc; fi
$ cat ~/.bashrc
foo=bar
alias blah=bleh
[[ -r /etc/hpc/bashrc ]] && . /etc/hpc/bashrc

There's no need to patch bash

Eduardo Bustamante <dualbus>
Sat 31 Jan 2015 03:12:47 AM UTC, original submission:  

Hi,

I suspect this has been discussed several times, so perhaps I'm missing some pointers;

As you may notice here, initialisation of bash is not generic across all invocation modes:
http://blog.flowblok.id.au/2013-02/shell-startup-scripts.html
This sends users cursing over hours about how the startup configurations function.

fi. If we wished to modify variable $SCRATCH under all circumstances, there is no single perfect way to do this. Question:

  • Is it possible/allowed to have a file /etc/bash.hpc which gets sourced in all cases?


The name of the file could be anything (/etc/hpc/bashrc or whatever); what matters is to have at least some hook that works reliably across distros and login modes. People on High Performance Computing platforms have been suffering a lot by this issue and each HPC site provides its own kind of workarounds. One more example:
https://github.com/TACC/Lmod/tree/master/contrib/bash_patch

So, your propositions/suggestions?
F.

ps.
If anyone of you is at FOSDEM'15, kindly inform to interact a bit faster on the topic.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Updated the item)
  • -email is unavailable- added by dualbus (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-11-13 chet StatusNone Wont Do

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code