The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > SUN Solaris
Google UNIX.COM


SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Path Environment mehmetned UNIX for Dummies Questions & Answers 2 02-09-2007 07:58 AM
Reset environment - ".. /etc/.environment dev_env" zzwu3591 UNIX for Advanced & Expert Users 7 01-12-2007 05:27 AM
parallel environment in aix mzzt AIX 0 01-09-2006 11:32 AM
environment variables spavlov UNIX for Dummies Questions & Answers 3 08-20-2003 06:49 AM
TOR environment variable Wittich UNIX for Dummies Questions & Answers 3 07-30-2003 09:40 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-11-2007
Registered User
 

Join Date: Jun 2007
Posts: 39
Stumble this Post!
Environment help please

Hello all,
I am a bit confused not only because I am new to Solaris but because when I run "env" I get a list of variables that are not in the user .profile. Where else can the account be getting environment variables from?

Is there a .profile that applies to all accounts?


Thank you in advance for your expertise.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-11-2007
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,513
Stumble this Post!
Quote:
Originally Posted by komputersman
Is there a .profile that applies to all accounts?
Yes, /etc/profile.

Others may be set by the shell when it initializes or the remote login service being used before initializing the shell (eg ssh sets some variables )
Reply With Quote
  #3 (permalink)  
Old 06-11-2007
Registered User
 

Join Date: Jun 2007
Posts: 39
Stumble this Post!
Hmmm

That dosen't look like it either... Here is what I am getting when I run "env"

USER=XXXXX
LOGNAME=XXXX
HOME=/home/XXXX
PATH=/opt/xampp/bin:/usr/local/bin:/usr/ccs/bin:/usr/bin/X11:/home/XXXXX/bin:/usr/sbin:/sbin:/usr/bin:/bin:/usr/ucb:/opt/gnu/gnat/bin
SHELL=/bin/tcsh
TZ=US/Arizona
SSH_CLIENT=XXXX
SSH_TTY=XXXX
TERM=xterm
HOSTTYPE=sun4
VENDOR=sun
OSTYPE=solaris
MACHTYPE=sparc
SHLVL=1
PWD=/etc
GROUP=other
HOST=prclab
REMOTEHOST=XXXX
LD_LIBRARY_PATH=/usr/lib:/usr/ucblib:/lib:/usr/local/lib:.=
DOORSHOME=/usr/local/doors
SERVERDATA=/usr/local/doors/data
PORTNUMBER=XXXX
DOORSDATA=XXXXX@localhost
LM_LICENSE_FILE=XXXX@XXXX
MANPATH=/opt/xampp/share/man:/usr/man:/usr/local/man:/usr/openwin/man:/usr/lang/man:/usr/share/man:/usr/local/teTeX/man
INFOPATH=/usr/local/info:/usr/local/teTeX/info
TETEXDIR=/usr/local/teTeX
ADA_INCLUDE_PATH=/opt/gnu/gnat/lib/gcc-lib/sparc-sun-solaris2.5.1/2.8.1/rts-native/adainclude/=
ADA_OBJECTS_PATH=/opt/gnu/gnat/lib/gcc-lib/sparc-sun-solaris2.5.1/2.8.1/rts-native/adalib/=
LD_LIBRARY_PATH=/usr/local/lib:/lib:/opt/SUNWspro/lib:.=
VISUAL=vi
EDITOR=vi


And here is my .profile...

MAIL=/usr/mail/${LOGNAME:?}

And should I have all these files? ...

.cshrc
local.cshrc
local.login
.profile
local.profile
.profileold

And here is the /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
"profile" [Read only] 46 lines, 712 characters


Where is it getting the rest from? Particularly I am interested in the doors related files.
Reply With Quote
  #4 (permalink)  
Old 06-11-2007
Registered User
 

Join Date: Jun 2007
Posts: 39
Stumble this Post!
Maybe this is a better way to ask....

How is it a user account gets its environment upon logging it, are there levels, like global settings then user settings? I am trying to figure our where the settins are being applied from so I can edit it.

Thank you,
Reply With Quote
  #5 (permalink)  
Old 06-11-2007
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,425
Stumble this Post!
Some stuff may be set by sshd daemon. Some stuff is set by the login program. But once the shell is exec'ed it will read the file like /etc/profile and .profile. You need to stop worrying about where they get set. You want to change them? If you want to change them for all users, do it in /etc/profile. For an individual user change them in .profile. It does not matter where they get set. Are you going to write a new sshd? Or a new login? Just put the stuff you want in the appropriate config file. The environment will be what you want before the shell passes control to the user. But remember that users can override your choices by putting stuff in their individual .profile files. You cannot control that.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:09 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0