shell's environment config

Denys Vlasenko vda.linux at googlemail.com
Fri Aug 7 21:52:30 UTC 2009


On Friday 07 August 2009 14:07, Gilles BULTHÉ wrote:
> Hello to all,
> 
> Using Busybox, I succeed in starting the shell with "::wait:/bin/sh" in the /etc/inittab file.
> 
> 1) is it a good way ?

Usually people use ::respawn:-/bin/sh

::wait: is meant for one-time initialization script,
if you use ::wait:/bin/sh, if you exit the shell,
it will not be restarted.

> Once the shell is started, the environment is not the one discribed in /etc/profile.

Use -/bin/sh, not /bin/sh.

dash means that the shell is a login shell,
IOW, this way you tell it to run /etc/profile and .profile.

> 2) how is the shell configurated when started ? witch file is used to set environment variables ?

hush.c contains some comments in hush_main().
It should be true for any shell.
--
cda


More information about the busybox mailing list