423ba10303
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
115 lines
2.7 KiB
Text
115 lines
2.7 KiB
Text
cinit 0.4 - Redesign of cinit
|
|
============================================
|
|
Nico Schottelius <nico-linux-cinit__@__schottelius.org>
|
|
0.4.0, for cinit 0.4, Initial Version from 2006-03-11
|
|
:Author Initials: NS
|
|
|
|
|
|
cinit 0.2 ran fine and the general project of developing a
|
|
parallel executing init system is finished.
|
|
With cinit 0.4 there are new aims to reach.
|
|
|
|
|
|
Introduction
|
|
------------
|
|
|
|
. AIMS
|
|
- portability: no Linux-dependency anymore
|
|
- cleaner signal handling
|
|
- better documentation so more people can use it
|
|
|
|
|
|
Current problems
|
|
----------------
|
|
|
|
Temporary filesystem and socket problematic
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
The mount(2) system call is os-specific.
|
|
The temporary fs is os-specific.
|
|
|
|
|
|
Signal handlers are not clean
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Race conditions when multiple signals arrive
|
|
|
|
|
|
Reboot code is os specific
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
serv/sig_reboot.c contains umount, remount hard coded.
|
|
|
|
|
|
Solutions
|
|
---------
|
|
|
|
Temporary filesystem and socket problematic
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Remove
|
|
- the mount call
|
|
- do not create an initial socket
|
|
|
|
Wait until we recieve a signal, then we create a socket
|
|
under the configured socket directory (see `conf/sockdir`).
|
|
|
|
|
|
Signal handlers are not clean
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Reboot code is os specific
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
Misc
|
|
~~~~
|
|
|
|
- Configuration
|
|
/etc/cinit/config/
|
|
init -> link to initial service
|
|
pre_boot
|
|
pre_boot_args
|
|
post_boot
|
|
post_boot_args
|
|
/etc/cinit/services/
|
|
/etc/cinit/profiles/
|
|
links to the starting services
|
|
|
|
|
|
|
|
cinit - Internals
|
|
=================
|
|
Nico Schottelius <nico-cinit__@__schottelius.org>
|
|
0.1 for cinit-0.3, Initial version: So Feb 19 10:25:46 CET 2006
|
|
:Author Initials: NS
|
|
|
|
|
|
Introduction
|
|
------------
|
|
This document describes the internals of cinit. It is thought
|
|
to be read by developers.
|
|
|
|
|
|
Child handler code in cinit-0.3
|
|
-------------------------------
|
|
|
|
In cinit versions <= cinit-0.2.1 the respawning services where
|
|
handled by an extra child handler, which was a fork of cinit. This
|
|
had some problems:
|
|
|
|
- We allocated more memory than necessary, unecessary parts of
|
|
cinit were copied
|
|
- The SIG_CHILD-handler was not written very clean, in some versions
|
|
it was completly missing.
|
|
|
|
|
|
. So in `cinit-0.3` we changed it the following way:
|
|
- no extra child handlers
|
|
- handle everything in the SIG_CHILD handling function
|
|
- when sig_child is recieved do:
|
|
- check against respawn list
|
|
- if it is a respawning service, [do the following in a seperate fork?]
|
|
check whether it successfully stoped
|
|
- if yes: restart immediatly
|
|
- if no: sleep $sleep_time and then restart
|