Matt Murphy on 12 Mar 2013 18:16:43 -0700

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

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

Those rc#.d scripts define environments for individual processes, I think. I don't think there's a quick way to do what you want to do. Anyone?


On Tue, Mar 12, 2013 at 4:42 PM, Fred Stluka <> wrote:
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 Â-- Â

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --