[erlang-questions] crazy thoughts: inittab and erl node

Jim Thompson jim@REDACTED
Tue May 8 00:43:16 CEST 2007


Alex Arnon wrote:

> Unix's init cannot be trivially replaced, as it spawns several critical 
> kernel threads, and manages runlevels as well.

untrue.  Many embedded systems use /bin/sh as a replacement for init, 
and, in fact, on linux (at least) you can pass "init=/bin/sh" to the 
kernel, and init won't be invoked at all, you'll be left at a 
rudimentary '#' prompt, and will need to check/mount non-root 
filesystems, etc.

The runlevels stuff is just you telling init what to do, plus a bit of 
processing to interpret things like 'power is failing'.

Having "init" start kernel threads would involve init loading modules 
into the kernel, (see: http://www.scs.ch/~frey/linux/kernelthreads.html)
No such thing happens (on an otherwise 'stock' system, anyway.)

But you are correct, that starting an erlang system from a boot script 
is likely the 'right thing', though if you've got two (or more) erlang 
"processes" protecting each other, you might have a difficult time 
killing them on shutdown.

Jim




More information about the erlang-questions mailing list