Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
best way to source /etc/profile in Konsole
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Farmboy
n00b
n00b


Joined: 10 Jul 2011
Posts: 22

PostPosted: Tue Feb 05, 2013 2:37 pm    Post subject: best way to source /etc/profile in Konsole Reply with quote

Hello everyone,
I am running Gentoo with KDE as DE. To log in I use KDM.

So there is never any login shell that can source /etc/profile for me.
The result is that running Konsole doesnt have the values from /etc/profile
because its supposed to get sourced only from a login shell.

So whats the correct, best or supported way to automatically source /etc/profile
in my case?

I could run Konsole with bash --login.
Not sure what the detrimental effects of this could be.
Since Konsole opens a new shell probably none.

Is there something else I can do?
What are your recommendations?

All input on this matter is appreciated.
Thanks in advance.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Tue Feb 05, 2013 7:00 pm    Post subject: Reply with quote

Hi,
the file $HOME/.bashrc is read by an interactive shell, a non login one. So you can create if not that file and add the line
Code:
source /etc/profile

That will ensure that Konsole will be sourced by /etc/profile at startup.
_________________
Paul
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1248
Location: 42.68n 85.41w

PostPosted: Wed Feb 06, 2013 12:03 am    Post subject: Reply with quote

mv ~/.bashrc ~/.bashrc.backup
mv ~/.bash_profile ~/.bash_profile.backup
mv ~/.bash_logout ~/.bash_logout
ln -s /etc/skel/.bashrc ~/.bashrc
ln -s /etc/skel/.bash_profile ~/.bash_profile
ln -s /etc/skel/.bash_logout ~/.bash_logout

is what i did.....

"
# Bash login shells run only /etc/profile
# Bash non-login shells run only /etc/bash/bashrc
"

im pretty sure any .bashrc or .bash_profile overrides those settings, they work as i expect at least.....
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Wed Feb 06, 2013 1:31 am    Post subject: Reply with quote

I am sorry, but I do not think it is a good idea to make symbolic links with users Bash configuration files to make them point to files in /etc/skel.

First, no user should be able to modify it's own Bash configuration files because they point to files who only root have write permissions. And if any user can modify files in /etc/skel, they will soon become unusable by any created and non created user.

Files in /etc/skel are skeletons and generics to all users and must stay as it. They are copied to the home directory of each user at creation time. It is those files in the home directory that are there to be modified by the user to allow him to personalise Bash as he want and override the system default configuration as he like.
_________________
Paul
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum