FS#4766 - /etc/profile shouldn't contain bash specific statements

Attached to Project: Arch Linux
Opened by Simon Morgan (sjmorgan) - Friday, 02 June 2006, 19:24 GMT
Last edited by Roman Kyrylych (Romashka) - Saturday, 09 February 2008, 15:06 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To Aaron Griffin (phrakture)
Architecture All
Severity Low
Priority Normal
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

/etc/profile is sourced by a lot of shells so putting bash specific statements in it such as:

export PS1='[\u@\h \W]\$ '

makes no sense. For instance try installing zsh and logging back in.
This task depends upon

Closed by  Roman Kyrylych (Romashka)
Saturday, 09 February 2008, 15:06 GMT
Reason for closing:  Fixed
Comment by Roman Kyrylych (Romashka) - Saturday, 03 June 2006, 12:54 GMT
Currently, /etc/profile is owned by bash package, so other shells should have their own /etc/profile.

I suggest the following:
1) move /etc/skel/.bashrc and /etc/skel/.bash_profile from filesystem package into bash package
2) move these lines from /etc/profile to /etc/skel/.bash_profile:
export PS1='[\u@\h \W]\$ '
export PS2='> '
if [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" -o "$TERM" = "rxvt" -o "$TERM" = "xterm-xfree86" ]; then
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
fi
3) move /etc/profile to filesystem package
Comment by Roman Kyrylych (Romashka) - Saturday, 03 June 2006, 12:58 GMT
The same for /root/.bashrc and /root/.bash_profile
Comment by Roman Kyrylych (Romashka) - Saturday, 08 July 2006, 10:08 GMT
Status?
Will this be changed?
Comment by Judd Vinet (judd) - Tuesday, 25 July 2006, 22:42 GMT
Which other shells try to run /etc/profile?

Isn't "export" itself a bash-specific statement? Or bourne-specific, anyway?
Comment by Roman Kyrylych (Romashka) - Wednesday, 26 July 2006, 06:02 GMT
What "dot" files do the various shells use?
http://www.faqs.org/faqs/unix-faq/faq/part5/section-6.html

ksh uses /etc/profile and .profile
Maybe newer versions of other shells too, I don't know.

Anyway I find moving all bash dot-files from filesystem to bash package more logical.


P.S.: What about LANG in /etc/profile? (I wrote about it in my last e-mail message to you)
Comment by Simon Morgan (sjmorgan) - Wednesday, 26 July 2006, 10:44 GMT
As I stated in my original message, zsh also uses /etc/profile. Although that page fails to mention it.
Comment by Andrea Garbarini (garba) - Saturday, 23 December 2006, 14:22 GMT
and what about simply telling the user "it's up to you to properly amend /etc/profile depending on the shells you are gonna install at your site"? :) the less /etc/ stuff comes with a package, the better, IMO
Comment by Andrea Garbarini (garba) - Saturday, 23 December 2006, 14:24 GMT
sorry i meant "the less the /etc stuff that comes..."
Comment by Holger Jorra (Trac3R) - Monday, 12 February 2007, 19:22 GMT
Well, look how Suse does it (attached). It looks like, /etc/profile is being read by many shells.
By the way, the /etc/inputrc should also include more stuff (commented maybe, so you can uncomment it if you want) and maybe there should also be a working history where every command is saved only one time. Otherwise the history is pretty unusable since half of the ~/.bash_history file is full of "su -" "ls" and "cd". Only FreeBSD's history is worse... I don't believe that this is against the K.I.S.S. principle.

I wanted to write a feature request now, but I think it also fits in here.
   profile (7.4 KiB)
   inputrc (5.1 KiB)
Comment by Roman Kyrylych (Romashka) - Sunday, 13 May 2007, 12:13 GMT
phrakture: i saw you already did some filesystem/bash/xorg-init cleanup. Please fix this one too.
Comment by Aaron Griffin (phrakture) - Monday, 14 May 2007, 16:20 GMT
Roman: I'll try. This one is far more complex, and requires lots more testing - but I'll get to it at some point - the other packages were tested by myself, dan, and maybe some other people for a few weeks before I made the move.
Comment by Greg (dolby) - Thursday, 10 January 2008, 02:34 GMT
what will happen when new bash enters core? is there gonna be an /etc/profile package provided by any other package?
i am asking cause /etc/profile now provides much more than the /etc/profile.bash from bash in testing.
especially sourcing the /etc/profile.d files. the one in testing doesnt have that at all
Comment by Roman Kyrylych (Romashka) - Thursday, 10 January 2008, 10:19 GMT
shell-independent /etc/profile is provided by the filesystem package
Comment by Aaron Griffin (phrakture) - Thursday, 10 January 2008, 17:06 GMT
@dolby: It is in the filesystem package, but is pending the pacman 3.1 release. There was an issue with pacman 3.0's backup handling when backup files change hands.

Loading...