Mailinglist Archive: opensuse-packaging (140 mails)

< Previous Next >
[opensuse-packaging] Re: Setting environmental variables
On Fri, 20 Jan 2012 15:05, Robert Munteanu <robert.munteanu@...> wrote:


I have a package (maven) which relies on the presence of a environment
variable (MAVEN_HOME) . I have created /etc/profile.d/maven.{csh,sh}
but these only work after the user logs out.

How can I make the environment variable available immediately after
the package is installed?

The most simple solution would be a wrapper to call your program.

This wrapper would check for non-zero variable and source
/etc/profile.d/maven.{csh,sh} if zero variable.

Best change to get your program work out-of-the-box.

If the user sets his private variable, it's respected, else it
defaults to a known source.

Modifing the environments of already started programs is difficult at best, ugly in most cases, and not reliable for sure.

Hope this gives you a way to go on successfully.

- Yamaban.
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >