From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.43) id 1EAF3i-0004lA-DF for garchives@archives.gentoo.org; Tue, 30 Aug 2005 22:58:26 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.4/8.13.4) with SMTP id j7UMsSnR014853; Tue, 30 Aug 2005 22:54:28 GMT Received: from mail.pnpitalia.it (85-18-21-122.ip.fastwebnet.it [85.18.21.122]) by robin.gentoo.org (8.13.4/8.13.4) with ESMTP id j7UMmqYR028861 for ; Tue, 30 Aug 2005 22:48:52 GMT Received: from localhost (localhost [127.0.0.1]) by mail.pnpitalia.it (Postfix) with ESMTP id C0E907AD6F8 for ; Wed, 31 Aug 2005 00:51:01 +0200 (CEST) Received: from mail.pnpitalia.it ([127.0.0.1]) by localhost (db [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23621-16 for ; Wed, 31 Aug 2005 00:51:01 +0200 (CEST) Received: from [192.168.4.153] (host-4-153.pnpitalia.it [192.168.4.153]) by mail.pnpitalia.it (Postfix) with ESMTP id 4FD737AD6F6 for ; Wed, 31 Aug 2005 00:51:01 +0200 (CEST) Message-ID: <4314DF64.5030402@gentoo.org> Date: Wed, 31 Aug 2005 00:36:20 +0200 From: Francesco R User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] init.d-scripts don't see stuff from /etc/profile.env References: <20050824082743.GA104763@lion.gg3.net> <1124877882.22517.2.camel@uberlaptop.ubernet> <200508251201.43416.pauldv@gentoo.org> <1125437576.13588.8.camel@uberpc.ubernet> <1125439595.10634.1.camel@uberpc.ubernet> In-Reply-To: <1125439595.10634.1.camel@uberpc.ubernet> X-Enigmail-Version: 0.92.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at db X-Archives-Salt: 94c80027-89ec-465a-834b-2ac3173c537e X-Archives-Hash: 1891ee91444bb095213075c1b53db1ee Roy Marples wrote: >I just love replying to myself! > >On Tue, 2005-08-30 at 22:32 +0100, Roy Marples wrote: > > >>#!/bin/sh >> >>/bin/env -i \ >> CONSOLETYPE="${CONSOLETYPE}" \ >> IN_BACKGROUND="${IN_BACKGROUND}" \ >> IN_HOTPLUG="${IN_HOTPLUG}" \ >> /lib/rcscripts/sh/runscript.sh $* >> >> > >A quick reboot shows we need much more. Here's what works on my system > >/bin/env -i \ > BOOT="${BOOT}" \ > CONSOLETYPE="${CONSOLETYPE}" \ > CRITICAL_SERVICES="${CRITICAL_SERVICES}" \ > START_CRITICAL="${START_CRITICAL}" \ > STOP_CRTIICAL="${STOP_CRITICAL}" \ > OLDSOFTLEVEL="${OLDSOFTLEVEL}" \ > SOFTLEVEL="${SOFTLEVEL}" \ > IN_BACKGROUND="${IN_BACKGROUND}" \ > IN_HOTPLUG="${IN_HOTPLUG}" \ > /lib/rcscripts/sh/runscript.sh $* > > > > >>Right away we can see that we actually do need some to keep some env >>vars and the list would be constantly updated. There's also nothing to >>stop the user from setting them and then running a script which kind of >>defeats the purpose here anyway. >> >>Personally I'm against this.I'd like to know what Azarah and Vapier >>think of this though. Others too! >> >> > >I think I just added a few more reasons why I don't like this .... > >Roy > > > Read only the last three messages of the thread, hoping to not say idiotic things. Rewriting the previous script in the following manner: [code] VARS_TO_EXPORT="BOOT CONSOLETYPE CRITICAL_SERVICES START_CRITICAL STOP_CRITICAL OLDSOFTLEVEL SOFTLEVEL IN_BACKGROUND IN_HOTPLUG" RUNSCRIPT="/bin/env -i" for i in ${VARS_TO_EXPORT} ; do RUNSCRIPT="${RUNSCRIPT} ${i}=\${${i}}" done RUNSCRIPT="${RUNSCRIPT} /lib/rcscripts/sh/runscript.sh $*" eval $RUNSCRIPT [/code] should make it easyer to maintain, also "VARS_TO_EXPORT" could be placed in /etc/rc.conf (with a better name) . Running the rc scripts from a clean environment make easyer to debug things, it caused at least one headheache to me installing SuSE + apache + php + informix some years ago. just my 2 cents. -- gentoo-dev@gentoo.org mailing list