Fred Stluka on 12 Mar 2013 13:42:42 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] Setting an environment variable for servers on Linux...

PLUG folks,

What's the best way to set an environment variable on Linux, so that
it is found not only by shells, but also for servers processes like

I have created:
        export HHL_ENVIRONMENT=test
        setenv HHL_ENVIRONMENT test
so now when any user logs in with any sh- or csh-based shell, the
env var is defined.

However, Apache and other servers are launched at boor time
via scripts and symlinks in /etc/rc.d, and they do NOT pick up
the env var.

Is there a single place to define it so all processes see it?  Or should
I just add the line:
    . /etc/profile.d/
to each of the appropriate files in:

I googled a bit and didn't find any better answer.

Any thoughts?  Thanks!
Fred Stluka -- --
Bristle Software, Inc -- -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --