Gentoo Archives: gentoo-dev

From: Georgi Georgiev <chutz@×××.net>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] init.d-scripts don't see stuff from /etc/profile.env
Date: Wed, 24 Aug 2005 08:31:49
Message-Id: 20050824082743.GA104763@lion.gg3.net
In Reply to: Re: [gentoo-dev] init.d-scripts don't see stuff from /etc/profile.env by Roy Marples
1 maillog: 24/08/2005-08:26:26(+0100): Roy Marples types
2 > On Tue, 2005-08-23 at 16:33 +0200, Sven Köhler wrote:
3 > > Hi,
4 > >
5 > > i just wrote an init.d-script and i thought that the LANG variable was
6 > > inherited since it set system-wide in /etc/env.d/02locale and therefor
7 > > is also found in /etc/profile.env
8 >
9 > Did you env-update?
10 >
11 > >
12 > > Now i noticed, that LANG isn't set for the process started by my
13 > > init.d-script.
14 >
15 > I set LANG and a few other things in /etc/env.d/02locale
16 >
17 > Here's a quick init script called test
18 >
19 > #!/sbin/runscript
20 >
21 > start() {
22 > set | grep LANG
23 > }
24 >
25 > Now, lets see what it does
26 >
27 > uberpc init.d # ./test start
28 > * Starting service test
29 > LANG=en_GB.utf8
30 > LANGUAGE=en_GB.utf8
31 > set | grep LANG
32 > * Service test started OK
33
34 Try unsetting the variable in your own shell first.
35
36 lion init.d # /etc/init.d/test restart
37 LANG=en_US.utf8
38 set | grep LANG
39 lion init.d # LANG=C /etc/init.d/test restart
40 LANG=C
41 set | grep LANG
42 lion init.d # env -u LANG /etc/init.d/test restart
43 set | grep LANG
44
45 --
46 / Georgi Georgiev / A new koan: If you have some ice cream, I /
47 \ chutz@×××.net \ will give it to you. If you have no ice \
48 / +81(90)2877-8845 / cream, I will take it away from you. It is /
49 \ ------------------- \ an ice cream koan. \
50 --
51 gentoo-dev@g.o mailing list

Replies