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?

MM

On Tue, Mar 12, 2013 at 4:42 PM, Fred Stluka <fred@bristle.com> 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
Apache?

I have created:
  /etc/profile.d/hhl.sh
    export HHL_ENVIRONMENT=test
  /etc/profile.d/hhl.csh
    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/hhl.sh
to each of the appropriate files in:
  /etc/rc.d/init.d

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

Any thoughts? ÂThanks!
--Fred
------------------------------------------------------------------------
Fred Stluka -- mailto:fred@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.
------------------------------------------------------------------------
___________________________________________________________________________
Philadelphia Linux Users Group     --    Âhttp://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion Â-- Â http://lists.phillylinux.org/mailman/listinfo/plug

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug