Gentoo Archives: gentoo-dev

From: Martin Schlemmer <azarah@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: init.d-scripts don't see stuff from /etc/profile.env
Date: Wed, 31 Aug 2005 07:27:17
Message-Id: 1125473129.7443.35.camel@lycan.lan
In Reply to: Re: [gentoo-dev] Re: init.d-scripts don't see stuff from /etc/profile.env by Mike Frysinger
1 On Tue, 2005-08-30 at 22:21 -0400, Mike Frysinger wrote:
2 > On Tuesday 30 August 2005 10:15 pm, Martin Schlemmer wrote:
3 > > On Tue, 2005-08-30 at 21:57 -0400, Mike Frysinger wrote:
4 > > > On Tuesday 30 August 2005 09:41 pm, Sven Köhler wrote:
5 > > > > > init.d scripts should have a pure env given to them ... which means,
6 > > > > > they should be run with `env -i` and have only whitelisted variables
7 > > > > > given to them (and everything that appears in /etc/conf.d/$service
8 > > > > > /etc/conf.d/rc and /etc/rc.conf) ...
9 > > > >
10 > > > > Now that may be too few variables. At least the variable LANG (or
11 > > > > whatever the system-admin may chose to set) could be seen as a
12 > > > > system-wide language-setting. It could be intentional, that at least
13 > > > > some variables are available to the started server-processes.
14 > > > > Especially a system-wide language-setting would be a good idea.
15 > > >
16 > > > that is the point of the whitelist idea ... we gather a 'full
17 > > > env' (source /etc/profile i guess) and rip out just the whitelisted
18 > > > variables to pass on to init scripts
19 > >
20 > > Although I agree, my personal opinion is that its going to be a major
21 > > PITA to maintain, and slow things down.
22 >
23 > with the first run, we cache the 'scrubbed' env, and then just use that in the
24 > future ?
25 >
26
27 We both know when somebody finally notice that, they will bitch because
28 the environment is not updated :) Damn, did I just point that out ? 8)
29
30 > > Also, not only runscript.sh
31 > > will have to be 'whitelisted', but also /sbin/rc, which will mean that
32 > > we now have to wrap two things. I guess a solution could have been to
33 > > use /sbin/runscript (the C thing) for both (should work fine
34 > > as /sbin/rc's interpreter as well), as that would buy some speed and
35 > > kill one bash fork, but the problem comes in when we start with a
36 > > vanilla environment that do not have /etc/profile sourced.
37 >
38 > mmm unification is good :)
39
40 I did not argue .. was just wondering how much gain (tears?) it will
41 bring us :)
42
43
44 --
45 Martin Schlemmer

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies