[BusyBox] init and again and tinylogin...

Gene Cumm greenpuddy at stny.rr.com
Wed Feb 12 15:11:03 UTC 2003


Berlin Brown wrote:
> Sorry, I messed up the message.
> 
> Ok, I have pretty much everything working with busybox, including init 
> but my system startup seems strange.  For example I have to explicity 
> set the shell in interactive mode, In my rc.sysinit(or rcS for debian 
> ppl)  And when I do a 'ps' I get this which is strange:
> 
> ---- init
> ---- /bin/sh rc.sysinit
> ---- /bin/sh -i             <--- this what I added in rc.sysinit
> 
> But when I take out the sh -i, then rc.sysinit stops executing and then 
> it goes back to the kernel.

Well, it makes sense that rc.sysinit sticks around since it's still 
attached to `/bin/sh -i`.  if you put `/bin/sh -i &` it'll release but 
that's a really backwards way to start a shell.  See below.

> So my question is...shouldnt busybox(init) run login or something or ask 
> for a password.  And what script should I put that in.  I can call login 
> manually for example in rc.sysinit but that also seems strange.
> Also when I compiled, tinylogin, I took out shadow passwords, so maybe 
> that is a problem.  So on a linux system what happens after the rc 
> scripts run?
> 
> Berlin Brown
> bigbinc at hotmail.com

Normally shells and logins are started by init via /etc/inittab.  A part 
of the reason for this is that init is a single task that doesn't often 
do a lot and designed only for starting proceses like this.  Restarting 
a shell involves  either init or a looping shell(BAD).  Try looking at 
yours on your development system (if a *nix) for a start and read Erik's 
info on how busybox\init works in the busybox docs.  There IS a default 
behavior but you overrode it with your /etc/inittab.  Worst case 
scenario is copy what Erik has in the docs and move up from there.

Here's what normally happens on a linux system(very briefly):
1)Boot, explode and run kernel
2)Kernel mounts a root and searches to run an init program
3)init opens /etc/inittab and runs it by a special sequence
   a)busybox and SysV Init run rc.sysinit or the like (an init script)
   b)SysV init also runs:
	1)a script associated with the init default runlevel
	2)some other things with different ID's
   c)Both get ready to run other programs under certain alert 
ID/runlevel's, ie restart, ctrlaltdel, etc.  If the associated 
runlevel/ID is activated, the given program is run.
   d)Lastly, both start the shells/logins for each console
4)The system is ready for you to use it.

I think the basic trends of this are also in most all *nix style systems.

(Erik, catch me if I am wrong on this:)  From what I've seen of 
busybox\init, it's designed only to run some programs to start, keep 
logins/shells running and reboot/halt the system.  It's very small, very 
light, and has the bare essential of functionality.

Note to anyone: If there is something I am mistaken about, feel free to 
correct me.  I've been know to make mistakes.




More information about the busybox mailing list