LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 02-26-2009, 06:00 PM   #1
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 536

Rep: Reputation: 36
Terminal Profile Strangeness with KDE4.2


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".

Thoughts.

Cheers.

***** 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.

Cheers.

Last edited by MQMan; 02-26-2009 at 08:01 PM. Reason: Update information
 
Old 02-27-2009, 11:11 AM   #2
Michielvw
Member
 
Registered: May 2005
Location: Leicester,UK
Distribution: Slackware
Posts: 108

Rep: Reputation: 19
Quote:
Originally Posted by MQMan View Post
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.
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.

There are several ways around this:

See
Code:
bash(1)
and especially the section on INVOCATION.

Or change the way Konsole is started (which really requires you to grok how/which files bash uses when started.

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.

Hope these hints help.
 
Old 02-27-2009, 01:29 PM   #3
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 536

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by Michielvw View Post
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".

Quote:
Originally Posted by Michielvw View Post
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.

Cheers.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Device Profile: M5900(i) portable data terminal LXer Syndicated Linux News 0 09-07-2006 05:54 AM
JAVA_HOME in /etc/profile doesn't work in GNOME terminal JoseVilla Linux - Newbie 7 04-09-2006 12:52 AM
Changing bash profile doesn't affect new terminal windows... SAFX Linux - Newbie 5 10-12-2004 11:51 AM
gnome-terminal profile errors Dancingsalad Linux - General 0 05-09-2004 12:37 AM
Terminal profile Phaethar Red Hat 1 11-21-2003 12:04 AM


All times are GMT -5. The time now is 03:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration