SlackwareThis Forum is for the discussion of Slackware Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm not sure if this is Slack specific, but I thought I'd start here.
I'm noticing some differences in the way the /etc/profile and /etc/profiles.d/* are being executed in Slack 12.2 with Pat's kde4.2 "upgrade" from /testing.
I always make one small change to /etc/profile, to change the prompt.
Now, here's what appears to be happening:
On a "native" term, it looks like /etc/profile is run, which in turn runs the contents of /etc/profile.d/*.sh. I get my "modified" prompt, and fortune only runs once.
When I open a term, from the kde4 "start" menu, it appears that /etc/profile is run, because again, I see my "modified" prompt. But, the contents of /etc/profile.d/*.sh are run twice. It's entirely possible that /etc/profile is run twice.
If I log out of kde4.2, with a terminal open, and then log back in, then when kde4.2 starts and re-opens the terminal, this time the contents of /etc/profile.d/*.sh are only run a single time, but my "modified" prompt is not set, so it looks like /etc/profile is not run. Also, this shell starts in ~/Desktop, instead of "home".
***** Update *****
Ignore the comment about the shell starting in ~/Desktop. It appears that the shell restarts in the same directory it was when the previous session ended.
As an experiment, I removed the /etc/profile modification, and added it as another script in /etc/profile.d/*.sh. When this was done, there was NO change in the final scenario. Also, I noticed that the prompt is the "default" prompt: bash-3.1. From this, I can conclude that when the shell is re-started this way, neither /etc/profile, nor the /etc/profile.d/*.sh scripts are executed. So, what scripts ARE used.
Last edited by MQMan; 02-26-2009 at 08:01 PM.
Reason: Update information
Which I believe is the normal way for things to work in KDE 4.2. IE, Konsole is not longer started as a login shell. Non-login shells do not use /etc/profile.
In which case, as I asked before, what files are used to populate the environment.
And based on this, I'm guessing that this is only the case for a "re-start" of Konsole. The fist time it's launched, it's a login shell, which forces /etc/profile to be run as well, which explains the "double entries".
Originally Posted by Michielvw
There are several ways around it, personally I set prompts for the user in their $HOME directory and leave /etc/profile well alone for system wide use.
That's kinda what my last change was. To leave /etc/profile "virgin", and add my changes elsewhere.