[BusyBox] startup scripts, environment, and ash

Finlay, Brion (STP) Brion.Finlay at guidant.com
Thu Feb 17 18:47:22 MST 2005


I have a startup script (/etc/init.d/rcS) that goes something like this:

---
swapon /dev/hda11

. /etc/profile

echo "export test0=test0" > /test0
. /test0

mount -t proc proc /proc

awk '{for(i=1;i<=NF;i++) print "export "$i}' /proc/cmdline > env-update
. env-update
---

/etc/profile contains various parameters like PATH, LD_LIBRARY_PATH, etc.

When startup is complete, and the interactive user shell is running, all of the variables set in /etc/profile are in the environment, the "test0" variable is not in the environment, and most (but not all, and only portions of some) of the variables put into "env-update" are in the environment.  

I have read some posts in the archives about how init forks a seperate shell and the variables in rcS shouldn't be in the environment of later shells.  If that is true, then why do the variables in my /etc/profile get loaded, and the same with most (but oddly, not all, and only portions of some) of the variables in my "env-update" file? 

I am using busybox 1.0
The shell is ash.






More information about the busybox mailing list