CarLinO System Initing
CarLinO_core has an istance of CarLinO_init to implemt the service (daemon) bootstrap. The
CarLinO init sequence has a policy different from Init SystemV. All services are launched with an order decided by developers to allow the immediate avilability of some base functions. For example in an embedded system, probably, the graphics and the sounds have a higher priority than network services. The kernel modules for graphics and sounds must be loaded before network modules, and so on ... This new policy in the loading order of services/modules can improve the system usability and interactivity.
_______________________ _____________________
| _________________| |_________________ |
| | | AMICO_link exchange messages | | |
| | | <----------------------------> | CarLinO_leash | |
| | CarLinO_process | |_________________| |
| | | <----. | |
| |_________________| | | |
| | | | CarLinO Application |
| CarLinO_core | | | |
| | | Add process in list | |
| | | | CarLinO Wrapper |
| ___________________| | | + |
| | | | | Linux application |
| | CarLinO_init | | |_____________________|
| | | | /|\
| | | -----' |
| | | |
| | | fork / respawn |
| | | ------------------------------------------|
| | | |
| | | _____\|/_____
| | | <----- /etc/carlino.conf | |
| |___________________| /etc/carlino.d/* | module |------.
| | |_____________| |
|_______________________| |
________________________________________________________________________________\|/_____
| |
| Kernel |
|________________________________________________________________________________________|
The class
APProcess provide an engine to spawn the processes with some policies to ensure the system stability. The class CarLinO_kickoff make a first fork to prepare the process spawn. The child process creates an istance of AMICO_link to communicate with CarLinO_core.
/|\ |
| | CarLinO_init
____|_______________|________________________________________________________________________________________________
| | APProcess
| _______|_______
| | | (child)
| | Fork |-----------.---------------------------------------------> 1. run 'prepare' script
| |_______________| | | 2. load 'drivers'
| | (parent) | |
| | | |
|_______________| | mode FORK / RESPAWN | mode NORMAL
_______\|/_______ _______\|/_______
| |(child) | |
.----------------->| Fork |-------------------->| Execute Process |
exit 0 | |_________________| | |_________________|
_________ | | (parent) | .
/|\ | | | .
| | mode FORK | mode RESPAWN \|/ .
| | _____________|_____________ run 'start' script .
| | | | .
| | No ____\|/___ | .
___|_______|___ exit 0 ________\|/________ .
| | | | .
| Check if stop | | Waiting for child | . . . . . . . .
| | | dead |
|_______________| |___________________|
| |
| |----------> run 'stop' script
|_____________________________________________|