The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to get time since last boot? siegfried High Level Programming 3 08-17-2006 01:40 AM
Defining Variables sailorliones UNIX for Dummies Questions & Answers 4 07-21-2006 12:09 PM
Reduce boot-time delay on FreeBSD? DownSouthMoe BSD 1 03-28-2004 12:07 AM
start a process at boot up time vtran4270 UNIX for Advanced & Expert Users 1 12-08-2002 04:31 PM
Disable routed daemon at boot time???? rrivas UNIX for Dummies Questions & Answers 2 04-09-2002 08:53 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-07-2002
Registered User
 

Join Date: Dec 2001
Posts: 29
Question Defining variables at boot time

Hi,

I'm looking for advice on where is the best place on Solaris to put a script that will setup system vairables prior to any users loging in. I've tried /etc/rc3.d without much success as the variables do not appear in the output from an env command.

I want the system to have these variables set without any user intervention.

Thanx.
Forum Sponsor
  #2  
Old 01-07-2002
thehoghunter
Guest
 

Posts: n/a
From the man pages:

The basic environment is initialized to:

HOME=your-login-directory
LOGNAME=your-login-name
PATH=/usr/bin:
SHELL=last-field-of-passwd-entry
MAIL=/var/mail/your-login-name
TZ=timezone-specification

For Bourne shell and Korn shell logins, the shell executes
/etc/profile and $HOME/.profile, if it exists. For C shell
logins, the shell executes /etc/.login, $HOME/.cshrc, and
$HOME/.login. The default /etc/profile and /etc/.login
files check quotas (see quota(1M)), print /etc/motd, and
check for mail. None of the messages are printed if the
file $HOME/.hushlogin exists. The name of the command
interpreter is set to - (dash), followed by the last com-
ponent of the interpreter's path name, for example, -sh.

Any system wide variables you want all 'users' to have should be placed in the /etc/profile and/or /etc/.login. Any 'user' specific (all Oracle DBA) should be set up on the individual profile or login in the home directory.
  #3  
Old 01-07-2002
Jimbo
Guest
 

Posts: n/a
Oops, deleting my reply since thehoghunter beat me to it, and quite a good reply!
  #4  
Old 01-07-2002
Registered User
 

Join Date: Dec 2001
Posts: 29
I've tried putting the entries in /etc/profile but when I login and use the env command to display the variables the entries aren't there.

Thanx.
  #5  
Old 01-07-2002
thehoghunter
Guest
 

Posts: n/a
Which version of Solaris? How are you logining in - console - telnet - rsh/rlogin - ssh ? What is the shell being used?

Please give an example of one of the variables attempting to be set (copy from the /etc/profile as it may just be a typo)
  #6  
Old 01-07-2002
Jimbo
Guest
 

Posts: n/a
env will show all variables that have been enabled for exporting with the export command. If a variable has not been flagged for export, it will not be shown by env, but you can see it with "set".
  #7  
Old 01-07-2002
Registered User
 

Join Date: Dec 2001
Posts: 29
Code as follows from /etc/profiles

#ident "@(#)profile 1.17 95/03/28 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=AT386
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)

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

umask 022
trap 2 3
CLASSPATH=/ianf
export CLASSPATH

I'm using Solaris 2.6

I'm loging in on telnet and console.


Thanx.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:52 PM.


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

Content Relevant URLs by vBSEO 3.2.0