LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 06-25-2003, 10:13 PM   #1
Locura
Member
 
Registered: May 2003
Distribution: Ubuntu 6.10 SE, Mac OS 10.4.8
Posts: 370

Rep: Reputation: 30
aliases set by /etc/profile not working in terminals in X


This kinda goes back to a problem I had in another thread, wanting to see the colored filenames/directories in the terminal. I set up global aliases, a custom shell prompt, and the colors and all that through a script called /etc/profile.d/alias.sh, and have it running along with the other *.sh scripts in /etc/profile.d due to the following code in /etc/profile.

Code:
for file in /etc/profile.d/*.sh ; do
  if [ -x $file ]; then
    . $file
  fi
done
Now, this works, UNTIL I run startx and enter my WM. Then no matter what terminal I try, none of them show the colors or the custom shell prompt, and none of the aliases work. Then if I exit my WM and am back at the console, they work again.

Last edited by Locura; 06-25-2003 at 10:16 PM.
 
Old 06-25-2003, 10:39 PM   #2
Locura
Member
 
Registered: May 2003
Distribution: Ubuntu 6.10 SE, Mac OS 10.4.8
Posts: 370

Original Poster
Rep: Reputation: 30
Oh, also, I noticed something wierd.

The prompt for my terminals in X is bash-2.05b$. That is NOT what it was when I first logged in (even prior to changing the entry in /etc/profile). So some other script must be overriding what /etc/profile is setting.
 
Old 06-25-2003, 11:06 PM   #3
contrasutra
LQ Guru
 
Registered: Mar 2003
Location: New Jersey
Distribution: Arch Linux
Posts: 1,445

Rep: Reputation: 47
You have tried putting the alias in ~/.bashrc ? That always works for me.
 
Old 06-25-2003, 11:21 PM   #4
Locura
Member
 
Registered: May 2003
Distribution: Ubuntu 6.10 SE, Mac OS 10.4.8
Posts: 370

Original Poster
Rep: Reputation: 30
Yeah, I have done that for aliases that I want for just my user, but these I want to be default for ALL users, hence they are in the global profile file, /etc/profile.
 
Old 06-25-2003, 11:35 PM   #5
contrasutra
LQ Guru
 
Registered: Mar 2003
Location: New Jersey
Distribution: Arch Linux
Posts: 1,445

Rep: Reputation: 47
You could just symlink every other users ~/.bashrc to one .bashrc, and then you would only have to change one. That might work, if you know that using .bashrc works in a terminal.
 
Old 06-26-2003, 12:18 PM   #6
LNXman
Member
 
Registered: Jul 2002
Location: California (USA)
Distribution: Slackware
Posts: 97

Rep: Reputation: 15
Which terminal are you using?

If you say that the /etc/profile works when you are not in X, but not when you are opening a terminal in X, then I assume that you may not have setup your terminal to be a login terminal.

For example, If you are using kconsole as your terminal, you will have to go to settings in KDE, and set kconsole to be a login terminal, so that the /etc/profile will be read.

I believe the same can be the case for other terminal apps. such as eterm, gnome-session, rxvt, xterm, etc.

Check it out. . .

GL
 
Old 06-26-2003, 01:19 PM   #7
Locura
Member
 
Registered: May 2003
Distribution: Ubuntu 6.10 SE, Mac OS 10.4.8
Posts: 370

Original Poster
Rep: Reputation: 30
Yeah, I actually just figured out the problem about an hour ago. Since my terminal is not a login shell, the terminals were looking for /etc/bashrc and ~/.bashrc for initialization. So, I just created an /etc/bashrc, and wrote a small script to see if the shell was a login shell, and if not to execute the bash scripts in /etc/profile.d. And so far so good, and all is well as long as the ~/.bashrc checks for the existence of /etc/bashrc and executes it if it exists (I added a couple lines to every user's ~/.bashrc to do so, and also added this to the default .bashrc in /etc/skel.
 
Old 06-26-2003, 03:21 PM   #8
newlin
Member
 
Registered: Jan 2003
Location: UK
Distribution: Red Hat 9 FC2
Posts: 52

Rep: Reputation: 15
i have konsole on my KDE taskbar but it does not appear in settings / control centre menu .could yo please say exactly where in KDE/settings to set konsole to a login shell so that it behaves identically to the login shell at boot time ..

There is nothing configured on the pc ,its out of the box default slackware 9

ie no bashrc or bash.profile or anything else,.. just /etc/profile.

thanks
 
Old 06-26-2003, 04:27 PM   #9
LNXman
Member
 
Registered: Jul 2002
Location: California (USA)
Distribution: Slackware
Posts: 97

Rep: Reputation: 15
Quote:
Originally posted by newlin
i have konsole on my KDE taskbar but it does not appear in settings / control centre menu .could yo please say exactly where in KDE/settings to set konsole to a login shell so that it behaves identically to the login shell at boot time ..

There is nothing configured on the pc ,its out of the box default slackware 9

ie no bashrc or bash.profile or anything else,.. just /etc/profile.

thanks
If I recall, you can open up a kconsole window, and access its preferences from its own menu. The menu that pops up, is the same as the one you would find if you searched for it under the KDE system configuration app. Once you are in the preferences for kconsole, you should be able to find that setting to make kconsole a login shell.

Sorry if I am not too detailed, but I don't use KDE, I only remember from what I played with when KDE 3.0 came out.

I am sure a fellow KDE user can help you better.

GL
 
  


Reply



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
setting virtusertable in sendmail creates problems with aliases set jomy Linux - Networking 1 11-03-2011 06:32 PM
Accessing Terminals in MEPIS. (Ctrl + Alt +F? not working) Eerath MEPIS 2 10-27-2005 10:51 AM
Global Aliases--Nothing is working! mooreted Slackware 2 06-15-2004 09:52 PM
X11 terminals not working as single-user jplev22 Linux - General 3 02-11-2004 10:31 AM
/etc/profile not working as it should Osten Debian 4 02-05-2004 01:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:53 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration