LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 05-31-2011, 03:30 PM   #1
thebombzen
Member
 
Registered: Dec 2010
Location: Noneya Business
Distribution: Linux Mint
Posts: 56

Rep: Reputation: 5
Question Set system-wide environment variables that hold when NOT using terminal


Hello, I am trying to set system wide environment variables that appear when not using a terminal. I already know how to do it for a terminal. For example, I created a file in /etc/profile.d/usrlocallib.sh which says
Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
and sure enough, every time I open a terminal and run printenv, /usr/local/lib is inside LD_LIBRARY_PATH.

Here is the problem: even though I set this variable for a terminal, I still get issues when not using a terminal. For example: when I open k3b from the Applications->Sound and Video menu, and click on the option /dev/dvd, with an encrypted dvd in my drive. It says "Install libdvdcss for video dvd decryption support." I have installed libdvdcss, in /usr/local/lib. So when I open a terminal, then run
Code:
k3b
It opens k3b perfectly fine, and when I click on /dev/dvd, it opens it perfectly fine without any errors, and can decrypt a dvd. So...

I need a way to set system-wide environment variables that hold even when not using a terminal: so I don't have to run all my GUI's from terminal.
 
Old 05-31-2011, 04:09 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Sounds like you actually want it user wide, not system wide, so I'd suggest just putting it in ~/.profile. System wide it could go in /etc/profile
 
Old 06-01-2011, 05:42 PM   #3
thebombzen
Member
 
Registered: Dec 2010
Location: Noneya Business
Distribution: Linux Mint
Posts: 56

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by acid_kewpie View Post
Sounds like you actually want it user wide, not system wide
No, I want it system wide. Where did I say user at all?

Quote:
Originally Posted by acid_kewpie View Post
so I'd suggest just putting it in ~/.profile. System wide it could go in /etc/profile
No. If you had read my post, it said that I already put a file in /etc/profile.d/. This is sourced by /etc/profile. Here is a section from /etc/profile:

Code:
# It's NOT a good idea to change this file unless you know what you
# are doing. It's much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.
And:

Code:
for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        if [ "${-#*i}" != "$-" ]; then 
            . "$i"
        else
            . "$i" >/dev/null 2>&1
        fi
    fi
done
 
Old 06-02-2011, 12:56 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Wow, that's an interesting way of making no one want to ever help you.
 
Old 06-02-2011, 09:02 AM   #5
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by acid_kewpie View Post
Wow, that's an interesting way of making no one want to ever help you.
What's wrong with wanting a variable to be visible in non-terminal applications system-wide?
 
Old 06-02-2011, 09:10 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by MTK358 View Post
What's wrong with wanting a variable to be visible in non-terminal applications system-wide?
nothing at all. But directly ignoring the given advice and picking holes in every word is hardly a smart way to get help.
 
Old 06-02-2011, 10:12 AM   #7
thebombzen
Member
 
Registered: Dec 2010
Location: Noneya Business
Distribution: Linux Mint
Posts: 56

Original Poster
Rep: Reputation: 5
I wasn't directly ignoring given advice, but stating that I had already tried what you suggested.
 
  


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
Setting up system wide environment variables gael Linux - Newbie 3 07-03-2009 01:28 PM
howto set system-wide environment variables permanently in debian vineet7kumar Linux - Newbie 2 05-08-2008 06:39 PM
where to put system-wide environment variables otoomet Linux - Software 2 01-07-2008 07:06 AM
How to set up an system wide environment variable permanently?? piyush.kansal Fedora 5 12-07-2007 04:04 AM
System wide Environment variables Steave Linux - General 1 02-08-2002 05:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

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