diff --git a/Documentation/applications/system/init/index.rst b/Documentation/applications/system/init/index.rst new file mode 100644 index 00000000000..489aa592be0 --- /dev/null +++ b/Documentation/applications/system/init/index.rst @@ -0,0 +1,157 @@ +====================== +``init`` Init +====================== + +Overview +======== + +In NuttX, there are various options for the init entry point, with NSH being +one of the commonly used ones. However, taking NSH as an example, it is not +suitable for all usage scenarios. For instance, the code size required by +NSH and NSH_LIBRARY is relatively large, and NSH lacks management +capabilities for daemons/services (such as restarting services). + +Therefore, we have newly implemented an Init component that is compatible +with most of the syntax of Android Init. It is lightweight, supports +command execution triggered by events, supports service/daemon management, +and its configuration files support include/import functionalities. + +Init.rc consists of five categories of statements, all line-oriented with +parameters separated by spaces. The content is processed by a preprocessor, +following C language specifications for escape rules and comment formats. +File path: /etc/init.d/init.rc. + +1. Actions and Commands +----------------------- +.. code-block:: + + on + + + + +- An Action (command sequence) contains trigger conditions. When satisfied, + it is added to the execution queue. +- Commands are the specific execution content of actions, such as setprop + (set system properties), start (start services), and mount (mount file + systems). + +2. Services and Options +----------------------- +.. code-block:: + + service [ ]* +