The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 04:40 AM
Defining Variables sailorliones UNIX for Dummies Questions & Answers 4 07-21-2006 03:09 PM
Reduce boot-time delay on FreeBSD? DownSouthMoe BSD 1 03-28-2004 03:07 AM
start a process at boot up time vtran4270 UNIX for Advanced & Expert Users 1 12-08-2002 07:31 PM
Disable routed daemon at boot time???? rrivas UNIX for Dummies Questions & Answers 2 04-09-2002 11:53 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-07-2002
ianf ianf is offline
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.
  #2 (permalink)  
Old 01-07-2002
thehoghunter
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
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 (permalink)  
Old 01-07-2002
Jimbo
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
Oops, deleting my reply since thehoghunter beat me to it, and quite a good reply!
  #4 (permalink)  
Old 01-07-2002
ianf ianf is offline
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 (permalink)  
Old 01-07-2002
thehoghunter
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
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 (permalink)  
Old 01-07-2002
Jimbo
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
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 (permalink)  
Old 01-07-2002
ianf ianf is offline
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:15 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0