This is a Unix init system developed in Python.
Q:
What's the point of developing an init system using hi-level language that additionally requires VM (an overhead)? Init systems, after all, should be light and responsive pieces of software.
A:
Python in the form of MicroPython was successfully re-implemented to run on microcontrollers – small computers with very limited memory and CPU resources.
Python is a flexible object-oriented language, great for expressing complexity – that Init System must deal with.
Project is developed with MicroPython limitations in mind (simplified modules and language API); therefore, it can be run on both - MicroPython and CPyhon.
Project's testing bench is AlpineLinux, however, porting it to another Linux distribution or unix system should be relatively straightforward.
MicroPython - VM and modules, provide multiple functions making it a good base for building Init System but also more. Aim of this project is to use MicroPython potential as much as possible.
-
In between OpenRC and SystemD –
yInitgoes beyond the scope of classic init systems like OpenRC and SysVinit – that are designed to handle service start/stop/monitoring while delegating tasks such as loginng, cron to specialized demons.yInitapproaches SystemD philosophy; that is to provide also essential services,yInithandles:a. Time – ensures OS runs with a correct time.
b. Network – ensures applications are capable of communication (necessary also for time synchronization).
c. Periodic tasks – provides cron functionality.
d. SSD trimming – Ensure partitions located on flash storage are mounted with a TRIM option, and/or periodic trims are enabled.
-
Parallel boot – boot services in parallel (if no dependency bound).
-
Web API – for initialization and management of machines over network.
Implementation of these features into a project makes it to
yInit defines the following targets that are used to classify services by task and also determinate at what boot stage service is to be loaded. Below-defined targets and its scopes, targets are in order of actual boot:
- init – does initializations of special filesystems: devfs, procfs, sysfs,
- launch – cheks and mounts root and user filesystems, loads drivers, sets up hardware settings, launches logging capability
- network – initializes network
- network.online – brings up network services that require network access; fullfilling this target means that the machine is probably online
- system – starts system services such as SSH server
- user – runs user related services: login manager, task scheduler.