LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-21-2003, 10:31 AM   #1
nightfox02
LQ Newbie
 
Registered: Jul 2003
Posts: 5

Rep: Reputation: 0
do profiles override each other?


I am currently having a problem with setting the PATH for all users...

I want my path to include the apache and postgresql binaries. However, when I open and edit /etc/profile as root the path seems to vanish when i change users....

The only thing I can think of is that when i change users the individual user profile is overriding the system profile....

Is this the way linux works?
 
Old 08-21-2003, 01:09 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,267

Rep: Reputation: 529Reputation: 529Reputation: 529Reputation: 529Reputation: 529Reputation: 529
"Is this the way linux works?"

Yes, try changing the PATH in the user profile. Or you could set the user profile so that it appends files to the default PATH rather than overriding it.

Also, the way that the PATH is set and changed is highly distribution dependent so what I am telling you may be done differently on your distribution.
 
Old 08-21-2003, 01:20 PM   #3
nightfox02
LQ Newbie
 
Registered: Jul 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Using Suse 8.2

Actually, I am using Suse 8.2...if what you said about the system still applies to SuSE please let me know...Thanks for your help
 
Old 08-21-2003, 03:20 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,267

Rep: Reputation: 529Reputation: 529Reputation: 529Reputation: 529Reputation: 529Reputation: 529
The way that SuSE recommends changing the PATH is this:

SuSE sets the default PATH in /etc/profile. They recommend that you do not change /etc/profile because SuSE will clobber your changes whenever you upgrade to a new SuSE release.

They recommend that you make your changes in /etc/profile.local and they will try to preserve that file during upgrades. If /etc/profile.local does not exist you can create it and the boot scripts will run it automatically at boot time. Make your changes as additions to the PATH, not as a replacement. Example:

In /etc/profile.local I placed the command:
export PATH=$PATH:/root/data/commands
which adds a file to the end of my existing PATH.

It is possible to configure the PATH for a user. SuSE combines the functions of .profile and .bashrc into .bashrc. So, if you want to make a PATH unique for a particular user then you would add an export PATH command to /home/user/.bashrc. SuSE does not set the user PATH to anything different.

So getting back to your original question the answer on SuSE is: No, the login shells for user do not replace the default PATH, although they could if they wanted to.

I suspect that when you changed /etc/profile that you placed your PATH statement before the SuSE PATH statement. Later in the code SuSE clobbered your PATH statement with their own. SuSE has some elaborate code for building the PATH and in a casual scan you might not recognize that building the PATH is what they are doing. It is also possible that they changed the code for release 8.2, making it different to what I am describing.

The end result is that the most likely way to get your PATH to work on SuSE is to get rid of your additions to /etc/profile and create a /etc/profile.local that appends the apache and postgresql binaries to the default path. Then boot.

Last edited by jailbait; 08-21-2003 at 03:22 PM.
 
  


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
How to Override main function in C joeyBig Programming 8 03-19-2018 06:37 AM
override defines alaios Programming 1 09-14-2005 10:40 AM
how to override Yenta? twolf Linux - Newbie 0 05-20-2003 11:54 PM
icmp_echo_ignore_all override for 1 IP Kostko Linux - Networking 1 03-06-2003 08:27 AM
How to override /etc/fstab? concoran Linux - General 3 10-04-2001 01:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:56 AM.

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