<br><br><div><span class="gmail_quote">On 5/8/07, <b class="gmail_sendername">Jim Thompson</b> <<a href="mailto:email@example.com">firstname.lastname@example.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Alex Arnon wrote:<br><br>> Unix's init cannot be trivially replaced, as it spawns several critical<br>> kernel threads, and manages runlevels as well.<br><br>untrue. Many embedded systems use /bin/sh as a replacement for init,
<br>and, in fact, on linux (at least) you can pass "init=/bin/sh" to the<br>kernel, and init won't be invoked at all, you'll be left at a<br>rudimentary '#' prompt, and will need to check/mount non-root
<br>filesystems, etc.<br><br>The runlevels stuff is just you telling init what to do, plus a bit of<br>processing to interpret things like 'power is failing'.<br><br>Having "init" start kernel threads would involve init loading modules
<br>into the kernel, (see: <a href="http://www.scs.ch/~frey/linux/kernelthreads.html">http://www.scs.ch/~frey/linux/kernelthreads.html</a>)<br>No such thing happens (on an otherwise 'stock' system, anyway.)<br><br>
But you are correct, that starting an erlang system from a boot script<br>is likely the 'right thing', though if you've got two (or more) erlang<br>"processes" protecting each other, you might have a difficult time
<br>killing them on shutdown.<br><br>Jim<br><br></blockquote></div><br>Indeed, 'init' is replaceable, and runlevels are a kind of convenience (which some Unix-like systems, such as some of the BSDs, do without). The kernel threads I was speaking of are usually privileged processes such as the swapper/pager, which are different between systems. On embedded systems with no HD, of course, these can be discarded as well.