LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 02-15-2006, 04:13 AM   #1
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Rep: Reputation: 31
How to maintain paths after reebooting?


I`ve edited $PATH and $LD_LIBRARY_PATH but everytime I reebot, the paths I entered are gone. How to make so that it stays?

Thanks.
 
Old 02-15-2006, 04:20 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
You can put them in /etc/profile so they are available to anyone who logs in that machine, or in your ~/.dtprofile to be available only for you.
 
Old 02-15-2006, 04:27 AM   #3
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by bathory
You can put them in /etc/profile so they are available to anyone who logs in that machine, or in your ~/.dtprofile to be available only for you.
the file "/etc/profile" seems a bit complicated to me. What would be the syntax for $PATH and $LD_LIBRARY_PATH ? And where should I write it in the file?
 
Old 02-15-2006, 04:54 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
You can put the commands just before umask 022. If you use sh or bash:
Code:
PATH=$PATH:/new/directory:/another/directory
export PATH
the same for LD_LIBRARY_PATH
If you use ksh replace "export" with "setenv" in the above

Regards
 
Old 02-15-2006, 12:43 PM   #5
fabianrios
Member
 
Registered: Apr 2005
Location: Atlanta
Distribution: FC3
Posts: 34

Rep: Reputation: 15
Unhappy Ld_library_path

Hi,
I managed to permanently change the PATH variable. However LD_LIBRARY_PATH resist any change. Can anybody explain to me why?
How can one define a env variable since it seems D_LIBRARY_PATH is not define by default?
Thanks in advance for your help,
Fabian.
 
Old 02-15-2006, 07:33 PM   #6
technopark02
Member
 
Registered: Feb 2005
Distribution: Solaris 8 - 11, JDS Linux 3.0
Posts: 99

Rep: Reputation: 15
Quote:
Originally Posted by fabianrios
However LD_LIBRARY_PATH resist any change. Can anybody explain to me why?
How did you set it up? I would suggest adding the LD_LIBRARY_PATH line to the shell initialization file (eg., ~/.cshrc for csh).

Quote:
How can one define a env variable since it seems LD_LIBRARY_PATH is not define by default?
At the process startup, run-time linker will check if LD_LIBRARY_PATH is set. If it is set, it will start searching the directories specified in LD_LIBRARY_PATH from left to right, until it either binds the symbol, or it runs out of directories to search for the symbol. If LD_LIBRARY_PATH has not been set, it will just search in the default paths ie., /usr/lib for 32-bit processes, and /usr/lib/64 for 64-bit applications.

So, you need not worry about LD_LIBRARY_PATH not being set, by default. Run-time linker (/usr/lib/ld.so.1) is aware of this env variable.
 
Old 02-16-2006, 03:20 AM   #7
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by bathory
You can put the commands just before umask 022. If you use sh or bash:
Code:
PATH=$PATH:/new/directory:/another/directory
export PATH
the same for LD_LIBRARY_PATH
If you use ksh replace "export" with "setenv" in the above

Regards
Thanks. It works for normal user but not for root. How may I mak it work for root?
 
Old 02-16-2006, 03:30 AM   #8
AbrahamJose
Member
 
Registered: Feb 2006
Location: India
Posts: 167

Rep: Reputation: 31
Shell

what is the default shell for the root and user
 
Old 02-16-2006, 03:35 AM   #9
AbrahamJose
Member
 
Registered: Feb 2006
Location: India
Posts: 167

Rep: Reputation: 31
Thumbs down More correct way

More correct way is
PATH=$PATH:/new/directory:/another/directory:.

Note the "." at the end
. stands for the current directory
If u don't have the "." , to run an executable file (say a.out) in your current directory, u have to give ./a.out instead of a.out

Last edited by AbrahamJose; 02-16-2006 at 03:37 AM.
 
Old 02-16-2006, 03:57 AM   #10
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Original Poster
Rep: Reputation: 31
I use bash.
 
Old 02-16-2006, 04:04 AM   #11
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by xpucto
I use bash.
Nobody's perfect ...
 
Old 02-16-2006, 04:24 AM   #12
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by jlliagre
Nobody's perfect ...
well actually the default shell ist ksh but as soon as I'm logged in, I changed manually to bash because I miss the tabb function.
What is it so bas about bash? What would you advice?

$PATH works with normal user under all shells, but with root it doesn't work nowhere.
 
Old 02-16-2006, 04:38 AM   #13
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by xpucto
well actually the default shell ist ksh but as soon as I'm logged in, I changed manually to bash because I miss the tabb function.
I know, actually ksh93 has this feature, but is not yet integrated in Solaris (you can download it from its site though).
There is a work in progress to have it in Solaris: http://www.opensolaris.org/jive/cate...?categoryID=53
Quote:
What is it so bas about bash?
Nothing particular, I prefer ksh but this is a lot a metter of taste and features I'm missing in bash, or behaviour I'm not used to.
Quote:
What would you advice?
No problem for you staying with bash.
Quote:
$PATH works with normal user under all shells, but with root it doesn't work nowhere.
Can you elaborate on that, there is no reason for PATH to have a different behaviour with root.
 
Old 02-16-2006, 05:01 AM   #14
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by jlliagre
Can you elaborate on that, there is no reason for PATH to have a different behaviour with root.
Well, I logg in through SSH as normal user. This user as the full PATH (with all variables), when I changed the shell, the user still have the correct PATH. When I do "su" and work as root, it doesn't have the corrected PATH no matter under which shell I'm working on.
Hier is my /etc/profile if it can help:
Quote:
cat /etc/profile
#ident "@(#)profile 1.19 01/03/13 SMI" /* SVr4.0 1.3 */

# The profile that all logins get before using their own .profile.

trap "" 2 3
export LOGNAME PATH

if [ "$TERM" = "" ]
then
if /bin/i386
then
TERM=sun-color
else
TERM=sun
fi
export TERM
fi

# Login and -su shells get /etc/profile services.
# -rsh is given its environment in its .profile.

case "$0" in
-sh | -ksh | -jsh | -bash)

if [ ! -f .hushlogin ]
then
/usr/sbin/quota
# Allow the user to break the Message-Of-The-Day only.
trap "trap '' 2" 2
/bin/cat -s /etc/motd
trap "" 2

/bin/mail -E
case $? in
0)
echo "You have new mail."
;;
2)
echo "You have mail."
;;
esac
fi
esac

PATH=$PATH:/usr/sfw/bin:/usr/ccs/bin
export PATH
umask 022
trap 2 3
 
Old 02-16-2006, 07:57 AM   #15
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Use a specific .profile file for root as root's PATH is overriden by what set is /etc/default/su and /etc/default/login (look for SUPATH variable).
 
  


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
how to maintain /proc filesystem hardeep_ubhi Linux - Newbie 6 03-22-2005 08:34 AM
unable to get the GUI screen for login after reebooting RH9 with ximian desktop jyotsna Red Hat 1 08-21-2004 10:18 AM
Maintain connection to internet d4d4n9 Mandriva 8 02-02-2004 01:21 AM
Automatically resolving WINDOWS paths to pre-configured Linux paths gazzy Linux - General 1 09-05-2003 10:15 PM
How does one maintain a linux PC? bxb32001 Linux - General 7 06-16-2001 01:28 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 07:33 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