Gentoo Archives: gentoo-dev

From: Roy Marples <uberlord@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] init.d-scripts don't see stuff from /etc/profile.env
Date: Tue, 30 Aug 2005 21:35:19
Message-Id: 1125437576.13588.8.camel@uberpc.ubernet
In Reply to: Re: [gentoo-dev] init.d-scripts don't see stuff from /etc/profile.env by Paul de Vrieze
1 On Thu, 2005-08-25 at 12:01 +0200, Paul de Vrieze wrote:
2 > On Wednesday 24 August 2005 12:04, Roy Marples wrote:
3 > >
4 > > Um, that's kinda like behaviour by design unless anyone can tell me
5 > > otherwise.
6 > >
7 > > /etc/env.d/* just set shell variables, so if you change one then you
8 > > need to
9 > >
10 > > env-update
11 > > source /etc/profile
12 > > /etc/init.d/thisdaemon restart
13 > >
14 > > To refresh the daemon that needs the vars
15 >
16 > Perhaps the init script loader should be changed such that the environment
17 > variables from the shell calling the script are ignored, and an
18 > environment equal to that when being called by init is used.
19 >
20 > Paul
21 >
22
23 I've been looking into this and the only easy solution I can find is to
24 move /sbin/runscript.sh to say /lib/rcscripts/sh, change it to
25 source /etc/profile and then create a new /sbin/runscript.sh like so
26
27 #!/bin/sh
28
29 /bin/env -i \
30 CONSOLETYPE="${CONSOLETYPE}" \
31 IN_BACKGROUND="${IN_BACKGROUND}" \
32 IN_HOTPLUG="${IN_HOTPLUG}" \
33 /lib/rcscripts/sh/runscript.sh $*
34
35 Right away we can see that we actually do need some to keep some env
36 vars and the list would be constantly updated. There's also nothing to
37 stop the user from setting them and then running a script which kind of
38 defeats the purpose here anyway.
39
40 Personally I'm against this.I'd like to know what Azarah and Vapier
41 think of this though. Others too!
42
43 Thanks
44
45 Roy
46
47 --
48 gentoo-dev@g.o mailing list

Replies