Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 5683 - Deafult shell "sh"? Better /etc/skel/ files.
Summary: Deafult shell "sh"? Better /etc/skel/ files.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: Low minor (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-28 14:17 UTC by Amit Pansare
Modified: 2003-02-04 19:42 UTC (History)
1 user (show)

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 Amit Pansare 2002-07-28 14:17:38 UTC
Most of the users like to have bash as their default shell. While adding a user,
newbies forget to give -s option. This makes sh as their default shell. Well sh
is linked to bash. But it behaves differntly. It doesnot read .bashrc. Most of
the users then lauch their xterms using -ls option, which is not quite right.
(Why not make bash as deafult shell rather than linking sh-> to bash? )

My suggestion is to make default shell to be bash and change
/etc/skel/.bash_profile and /etc/skel/.bashrc which are bit weird.

since bashrc is being sourced by bash_profile, it would be better that bashrc
contents whatever right now lies in bash_profile.

It seems that, PATHS are being updated to /etc/profile and profiles.env. So it
would be good idea if we have /etc/skel/.bashrc as given below:

Code:
------------------------------------------
if [ -f /etc/profile ]; then                                                   
        source /etc/profile                                                     
fi                                                                             
                                                                               
eval `dircolors -b /etc/DIR_COLORS`                                                 
                                                                               
alias ls='ls --color=always -phsFv'                                             
alias rm='rm -iv'                                                               
alias cp='cp -iv'                                                               
alias mv='mv -iv'               
---------------------------------------------
Aliases can be different

And /etc/skel/.bash_profile can be this way:
Code:
--------------------------------------------------

if [ -f ~/.bashrc ]; then                                                       
        source ~/.bashrc                                                       
fi         
         

---------------------------------------------------

This way PS1,PATH and other enviromental variables will get value from updated
/etc/profile. 

I hope these changes will make things much easier and clean.
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2002-07-29 14:53:24 UTC
Ok, I have a few problems with this:

1)  How do you want to change the "default shell" ?  If there is no shell
    defined in /etc/passwd, then login will start /bin/sh.  This is a universal
    behaviour, and can only be changed by either hacking up login, or bash (
    for bash not to behave like sh when started as sh)

2)  The reason why we do not source /etc/profile in .bashrc, is because when
    you "su" to an account instead of "su -", you want the environment to be
    kept intact.  This is one reason .. sure there is many others.  The point
    is,  /etc/profile, ~/.bash_profile and ~/.profile only gets sourced if
    it is an interactive *login* shell.

3)  Why we source ~/.bashrc, is because this is where users usually keep thier
    aliases, etc that they want available in an interactive shell (mind you,
    not always a login shell).  I know about the "dircolors" issue (another bug
    i cannot remember the number of).

This has come up too many times, and there is already too many bugreports,
although it seems they are not read :(   Gentoo is a distro for 
intermediate/advanced users.  And frankly, the best way to learn the proper
way is unfortunately sometimes the hard way.

Thus, I do not think that adding commands for sourcing /etc/profile to
~/.bashrc is an good idea.  It will make things behave as the more advanced
user will not expect, and really .. it being defaults, is just that .. defaults.
If the user really want to do weird things like this, it is his right to ...
on his own box.

The correct way of doing it, is to enable the "run as login shell" in gnome
or start konsole with "konsole -l" (if I remember correctly).  If it is really
a newbie, then there is more then enouth bugs here, posts on the forums, or
advanced users in #gentoo who will not mind to help.
Comment 2 SpanKY gentoo-dev 2002-08-02 23:15:27 UTC
Similar bugs:
http://bugs.gentoo.org/show_bug.cgi?id=4313
http://bugs.gentoo.org/show_bug.cgi?id=4955
http://bugs.gentoo.org/show_bug.cgi?id=5629
http://bugs.gentoo.org/show_bug.cgi?id=5683
http://bugs.gentoo.org/show_bug.cgi?id=5699

everyone has something diff to say ... think it should all be wrapped up and 
put into 1 bundle though ;)
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-25 13:28:21 UTC
Changed the shell for /etc/X11/xdm/Xsession and /etc/X11/gdm/PreSession/Default
to "/bin/bash --login".  Please check the ChangeLogs, and then remerge them
(xfree-4.2.1-r2, gdm).