On Thu, 28 Oct 1999, you wrote: 
> We are currently struggling through Linux's convoluted startup and
shutdown 
> sequencing for one of our embedded projects. 
>  
> We long for something like exists in the QNX OS.  There all the startup 
> info is contained in a single script.  While this maybe less flexible
than 
> the current Linux scheme, it is much better suited to an embedded system. 
>  
> Is there any good documentation online regarding this? Are there any open 
> source projects which are aimed at producing a QNX style startup and 
> shutdown sequence?  If not would there be any interest in starting one
up? 
> Robert D. Findlay 
> Senior Software Engineer 

It's really not that complex. In a typical Linux system, everything is
started by
init (you can replace the normal init easily too), according to
/etc/inittab.
This includes the startup and shutdown sequence.

Typically, /etc/rc.sysinit is run _once_ at boot time. Then other scripts
are run
each time init enters a new runlevel. Using /sbin/runlevel you can
determine
which runlevel you currently are in, and what the previous runlevel was.
This
is sufficient information to know what to start and stop (assuming you've
decided
on your policy for it, of course :-)

Redhat for instance use runlevel 0 to indicate halt, and 6 for reboot, and
1 for
single user mode (almost nothing is started, and you get a shell without
login).
Redhat also use a single script (/etc/rc.d/rc) to start and stop everything
after
rc.sysinit has run (rc.sysinit typically doesn't start any long running
processes,
but only handle things that needs to be done once during boot regardless
of what runlevel you want to boot to).

So what you need to do is to determine what you need to start and stop, and
how to group it. If you want to lump everything together, and either start
or stop
everything, it should be rather simple: Just create one script to start
everything,
and one script to stop everything, and add them to inittab for the
appropriate
runlevels.

Vidar Hokstad
VP, R&D
Screen Media


--
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the command "unsubscribe linux-embedded" in the message body.
For more information, see <http://waste.org/mail/linux-embedded>.

Reply via email to