From: TyBreaker <tybreaker@hotmail.com>
Subject: Re: Quest: how to set global environment variables?
Date: Thu, 13 Feb 2003 20:40:34 +1100 [thread overview]
Message-ID: <9CJ2a.46612$jM5.116992@newsfeeds.bigpond.com> (raw)
In-Reply-To: <1045047297.37541@sky.aect.cuhk.edu.hk>
> Would like to set a global environment variable for a daemon process. Daemon
> process is placed in /usr/sbin, owned by root:system.
> -- What should the right way to do so?
> -- Which file should keep those "export" statement?
>
> A simple script with export statement, named "S999TEST" are placed in
> /sbin/rc2.d and /sbin/rc3.d. But, after system is rebooted, still not make
> any affect.
>
> S999TEST:
> --------------------------------------------------
> TEST_ENV_003=AlbertoErica003
> export TEST_ENV_003
> --------------------------------------------------
ENVIRONMENT variables are purely a shell concept. Each account that
actually has a shell specified in it's passwd entry and creates
processes would need any global environment variables in it's .profile
(sh) or .cshrc (csh) etc such that any process they create picks up
these environment variables when a new shell is spawned.
Having said this there are very few reasons why you should want to place
environment variables in such a global position. It is better practice
to do as the other post said and create a startup script for your daemon
and place any environment variables within it.
Even better again would be to develop your daemon further and add the
ability for it to accept arguments on the command line to specify any
info it might need.
prev parent reply other threads:[~2003-02-13 9:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-12 10:51 Quest: how to set global environment variables? Albert
2003-02-13 5:56 ` Joe Chung
2003-02-13 9:40 ` TyBreaker [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox