From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,44c7a666aee27018 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2003-02-12 21:56:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed-east.nntpserver.com!nntpserver.com!chi1.webusenet.com!news.webusenet.com!cyclone1.gnilink.net!wn14feed!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc03.POSTED!not-for-mail Newsgroups: comp.unix.tru64 Subject: Re: Quest: how to set global environment variables? References: <1045047297.37541@sky.aect.cuhk.edu.hk> From: Joe Chung Message-ID: User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 12.234.205.63 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc03 1045115793 12.234.205.63 (Thu, 13 Feb 2003 05:56:33 GMT) NNTP-Posting-Date: Thu, 13 Feb 2003 05:56:33 GMT Organization: AT&T Broadband Date: Thu, 13 Feb 2003 05:56:33 GMT Xref: archiver1.google.com comp.unix.tru64:9533 "Albert" writes: > Dear all, > > 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 > -------------------------------------------------- > > Best Regards, > A. John How is the daemon process started? In the script that starts the daemon is where you need to set the environment variables. Look at any /sbin/rc*.d/S* script and see how they set various environment variables BEFORE invoking the daemon process. -jc -- (apply 'concat (reverse (list "com" (char-to-string 46) "yahoo" (char-to-string 64) "joechung")))