LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-02-2005, 05:45 PM   #1
Ham1am
LQ Newbie
 
Registered: Jun 2004
Distribution: Redhat 9.0
Posts: 5

Rep: Reputation: 0
Setting environment variables for all users?


Hi folks. I've scoured the net, and can't find a solution that works for this problem. I've installed ImageMagick (on a solaris 10 sparc server), and when I manually set the paths/variables, it works for that login. If I log out, they're gone. To no surprise, apache can't use them either..

I've tried setenv, mod'd /etc/default/init, /etc/profile (someone told me to put my variables into /etc/default/global.. that didn't work) and it never sticks.

Anyone know how to globally, and permanently set a variable for solaris so apache can use an the variable?

Thanks
Ham

Last edited by Ham1am; 05-02-2005 at 05:49 PM.
 
Old 05-02-2005, 07:33 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
You should be able to set them in /etc/profile using:

Code:
export VARIABLE=value
 
Old 05-03-2005, 12:08 AM   #3
Ham1am
LQ Newbie
 
Registered: Jun 2004
Distribution: Redhat 9.0
Posts: 5

Original Poster
Rep: Reputation: 0
*should* is the key word

I didn't do it exactly as you described.. but close.

Code:
MAGIC_HOME=/usr/local/ImageMagick
export MAGIC_HOME
is how I did it.. I'm guessing that's basically the same thing. I'll have to give that a whirl tomorrow.. I'll keep you posted.

Thanks
Ham
 
Old 05-03-2005, 12:40 AM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
that should work fine, IIRC.
 
Old 05-03-2005, 12:46 AM   #5
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
That's correct, do not use the short syntax "export var=value" in /etc/profile.
It is a syntax error with /bin/sh and understood only by ksh and bash.
 
Old 05-03-2005, 09:18 AM   #6
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
I was not aware of the problems with the short version. I stand corrected.
 
  


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
Environment variables setting... simjii SUSE / openSUSE 4 11-19-2005 07:50 PM
Need help setting environment variables. cottonmouth Linux - Newbie 3 12-09-2004 04:54 PM
Setting Environment Variables farzan Linux - Newbie 2 08-07-2004 09:13 AM
setting environment variables durden2.0 Linux - Newbie 5 07-15-2003 01:57 PM
setting environment variables rezza Linux - Distributions 2 04-09-2003 08:21 AM

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

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