Can I set up my own sub-environment?

Harald Becker ralda at gmx.de
Fri Feb 4 11:32:42 UTC 2011


 Hallo David!

> sub-environment?

Every process has its own environment. To set up your own environment
just start a new process with an empty environment. From there you can
add to your environment what you like/need.

> Is there any reason why that would upset 'standard' functions like
> OpenVPN, PPP, dhcp or anything else, if I start them up from an
> environment where they don't access the original /bin and friends? 
Several programs use hard coded directories to access standard utilities
and configuration files. You won't be able to change this by just adding
something to your environment.

> at the start of S94netrix.... will everything invoked from it inherit
> it....
Child processes always inherit the environment of there parents. As this
you do not need to set up your environment on every child invocation.
Keep an eye on "ENV=", it only works with ash.

If you need a complete separate constellation of tools etc. you may
consider to run your application in a chroot setup. That will isolate
your application from the rest of your file systems, but you need to
duplicate everything you need.

--
Harald



More information about the busybox mailing list