Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 698672 - Systemwide /etc/bash/bashrc and /etc/bash/bashrc.d/* are ignored in prefix
Summary: Systemwide /etc/bash/bashrc and /etc/bash/bashrc.d/* are ignored in prefix
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-27 17:13 UTC by Logan Perkins
Modified: 2021-01-18 19:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Logan Perkins 2019-10-27 17:13:50 UTC
While this behaviour is likely intended, and generally fine, it does lead to unintuitive side effects for new prefix users.  Specifically, systemwide customizations to HISTSIZE and HISTFILESIZE are ignored, which leads anyone using the startprefix script to overwrite and destroy their history file.  

The simplest solution would be to copy /etc/bash/* to $EPREFIX/etc/bash, but failing that, a warning in the eprefix install script would be prudent.
Comment 1 Fabian Groffen gentoo-dev 2019-10-28 10:01:39 UTC
this behaviour is indeed very intended, and necessary for proper operation also

I'm not sure if users are actually very aware of what's in their host-provided bashrc files, but do you think a warning with some examples would suffice here?
Comment 2 Logan Perkins 2019-10-29 22:40:39 UTC
I think you're likely correct that many users are unaware of the contents (or the existence) of the systemwide bashrc files.  It's most likely to cause problems when a sysadmin customizes the systemwide bashrc.  The prefix shell then ignores the systemwide files, which can cause subtle (or not so subtle) breakages.

I think a note in the auto installer script saying that if you have system wide bashrc stuff you should do something intelligent would suffice.  

I don't think we can programatically determine what 'intelligent' is, especially since we want to support non gentoo host systems.  Some users might want to specify a prefix specific HISTFILE, some might want to just copy their host bashrc files, some might not care.  Just letting people know not to run the prefix bash before resolving any issues would probably be enough.  

As for where in the auto installer to put the message... The actual damage comes from running the startprefix script, so the startscript target of the bootstrap script may be a good target.  The introductory text and interactive mode would also be a good target.  A slightly more ambitious goal would be to ask the user in interactive mode for any scripts to drop in the prefix, but that would require more careful thought and checking than just adding a few examples and a warning.
Comment 3 Logan Perkins 2019-10-29 22:46:30 UTC
Also, I think a note should get added to the gentoo wiki article on the bootstrap script, but I lack the permissions to edit that page.