Re: [PR] doc/system: Add documentation for NXInit [nuttx]
linguini1 merged PR #18967: URL: https://github.com/apache/nuttx/pull/18967 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] doc/system: Add documentation for NXInit [nuttx]
linguini1 commented on code in PR #18967: URL: https://github.com/apache/nuttx/pull/18967#discussion_r3313631783 ## Documentation/applications/system/nxinit/index.rst: ## @@ -0,0 +1,137 @@ +== +``nxinit`` NXInit +== + +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). + +NXInit was create to solve these issues. It was implemented an NXInit 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. + +The ``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 [ ]* + + + ... + +- A Service is a program started by Init, with a unique name (can be overridden + via the override option). +- Options are modifiers for services, affecting their running mode and timing. + Examples include class (specify service category for batch start/stop), + override (override previously defined services), restart_period (interval + for restarting exited services), and reboot_on_failure (critical services + trigger device reboot on startup failure or abnormal exit). + +Triggers + + +The triggers of an action serve as its triggering conditions, supporting +one or more triggers (which must all be satisfied simultaneously). + +There are two types of triggers: event triggers (e.g., boot) and action +triggers (also known as property triggers, e.g., property:a=b). Actions can +include multiple action triggers but only one event trigger. Triggers can be +combined with && to represent "AND" conditions. + +.. note:: Currently, only event triggers are supported; action triggers will be uploaded later. Review Comment: ```rst .. note:: Currently, only event triggers are supported. .. todo:: Implement action triggers. ``` ## Documentation/applications/system/nxinit/index.rst: ## @@ -0,0 +1,137 @@ +== +``nxinit`` NXInit +== + +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). + +NXInit was create to solve these issues. It was implemented an NXInit 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. + +The ``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 [ ]* + + + ... + +- A Service is a program started by Init, with a unique name (can be overridden + via the override option). +- Options are modifiers for services, affecting their running mode and timing. + Examples include class (specify service category for batch start/stop), + override (override previously defined services), restart_period (interval + for restarting exited services), and reboot_on_failure (c
Re: [PR] doc/system: Add documentation for NXInit [nuttx]
acassis commented on code in PR #18967: URL: https://github.com/apache/nuttx/pull/18967#discussion_r3311397642 ## 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 [ ]* + + + ... + +- A Service is a program started by Init, with a unique name (can be overridden + via the override option). +- Options are modifiers for services, affecting their running mode and timing. + Examples include class (specify service category for batch start/stop), + override (override previously defined services), restart_period (interval + for restarting exited services), and reboot_on_failure (critical services + trigger device reboot on startup failure or abnormal exit). + +3. Imports +-- +Used to import other configuration files, supporting single files or all files +in a directory (non-recursive). + +.. code-block:: + +import + +In addition, since init.rc undergoes compiler preprocessing, we can also +include other configuration files during the preprocessing stage using +the #include directive. + +.. code-block:: + +#include "example.rc" + +Triggers + + +The triggers of an action serve as its triggering conditions, supporting +one or more triggers (which must all be satisfied simultaneously). + +There are two types of triggers: event triggers (e.g., boot) and action +triggers (also known as property triggers, e.g., property:a=b). Actions can +include multiple action triggers but only one event trigger. Triggers can be +combined with && to represent "AND" conditions. + +Note: Currently, only event triggers are supported; action triggers will be +uploaded as soon as possible. + +1. Event Trigger Execution Order + +1. boot: The first event after Init starts. +2. init: After BOARDIOC_INIT completes. +3. netinit: Optional, after netinit_bringup() returns. +4. finalinit: After BOARDIOC_FINALINIT completes. + +2. Action Triggers Checking +--- +- All action triggers are automatically checked once at startup. +- Property triggers are checked when the property is created or its value + is updated (e.g., property:a=b is checked when a's value changes). + +Commands + +The commands supported by an action fall into three types: the built-in +commands of Init, the built-in commands of NSH (if NSH is enabled), and +Builtin Apps. + +The following is an explanation of some of Init's built-in commands +(some are still under development). Review Comment: I will remove then from "Others", to make the documentation more honest -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] doc/system: Add documentation for NXInit [nuttx]
acassis commented on code in PR #18967: URL: https://github.com/apache/nuttx/pull/18967#discussion_r3311391713 ## 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 [ ]* + + + ... + +- A Service is a program started by Init, with a unique name (can be overridden + via the override option). +- Options are modifiers for services, affecting their running mode and timing. + Examples include class (specify service category for batch start/stop), + override (override previously defined services), restart_period (interval + for restarting exited services), and reboot_on_failure (critical services + trigger device reboot on startup failure or abnormal exit). + +3. Imports +-- +Used to import other configuration files, supporting single files or all files +in a directory (non-recursive). + +.. code-block:: + +import + +In addition, since init.rc undergoes compiler preprocessing, we can also +include other configuration files during the preprocessing stage using +the #include directive. + +.. code-block:: + +#include "example.rc" Review Comment: Good catch! Removed! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] doc/system: Add documentation for NXInit [nuttx]
acassis commented on code in PR #18967: URL: https://github.com/apache/nuttx/pull/18967#discussion_r3311202590 ## 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 [ ]* + + + ... + +- A Service is a program started by Init, with a unique name (can be overridden + via the override option). +- Options are modifiers for services, affecting their running mode and timing. + Examples include class (specify service category for batch start/stop), + override (override previously defined services), restart_period (interval + for restarting exited services), and reboot_on_failure (critical services + trigger device reboot on startup failure or abnormal exit). + +3. Imports +-- +Used to import other configuration files, supporting single files or all files +in a directory (non-recursive). + +.. code-block:: + +import + +In addition, since init.rc undergoes compiler preprocessing, we can also +include other configuration files during the preprocessing stage using +the #include directive. + +.. code-block:: + +#include "example.rc" + +Triggers + + +The triggers of an action serve as its triggering conditions, supporting +one or more triggers (which must all be satisfied simultaneously). + +There are two types of triggers: event triggers (e.g., boot) and action +triggers (also known as property triggers, e.g., property:a=b). Actions can +include multiple action triggers but only one event trigger. Triggers can be +combined with && to represent "AND" conditions. + +Note: Currently, only event triggers are supported; action triggers will be +uploaded as soon as possible. + +1. Event Trigger Execution Order + +1. boot: The first event after Init starts. +2. init: After BOARDIOC_INIT completes. +3. netinit: Optional, after netinit_bringup() returns. +4. finalinit: After BOARDIOC_FINALINIT completes. + +2. Action Triggers Checking +--- +- All action triggers are automatically checked once at startup. +- Property triggers are checked when the property is created or its value + is updated (e.g., property:a=b is checked when a's value changes). + +Commands + +The commands supported by an action fall into three types: the built-in +commands of Init, the built-in commands of NSH (if NSH is enabled), and +Builtin Apps. + +The following is an explanation of some of Init's built-in commands +(some are still under development). Review Comment: I think only "wait" and "loglevel" are not implemented. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] doc/system: Add documentation for NXInit [nuttx]
acassis commented on PR #18967: URL: https://github.com/apache/nuttx/pull/18967#issuecomment-4555054412 > My remarks: > > * create common description of init describing possibilities. > > * create dedicated page for nsh/init.d and nxinit with detailed description and crosslink to the top document. > > * there is a `.. warning::` rst mark that we can use to mark nxinit as work-in-progress experimental solution. @cederom I liked the idea, but this PR is focused on NXInit. Could you please create an Issue with this suggestion? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] doc/system: Add documentation for NXInit [nuttx]
acassis commented on code in PR #18967: URL: https://github.com/apache/nuttx/pull/18967#discussion_r3311004466 ## 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 Review Comment: But we need a transition words between the first paragraph and the second one, just starting the 2nd paragraph with "NXInit is ..." is not a good option. I will start with something like: "NXInit was created to solve these issues ..." this way the transition will be more smooth -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] doc/system: Add documentation for NXInit [nuttx]
cederom commented on PR #18967: URL: https://github.com/apache/nuttx/pull/18967#issuecomment-4549514520 My remarks: * create common description of init describing possibilities. * create dedicated page for nsh/init.d and nxinit with detailed description and crosslink to the top document. * there is a `.. warning::` rst mark that we can use to mark nxinit as work-in-progress experimental solution. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] doc/system: Add documentation for NXInit [nuttx]
cederom commented on code in PR #18967: URL: https://github.com/apache/nuttx/pull/18967#discussion_r3307175029 ## Documentation/applications/system/init/index.rst: ## @@ -0,0 +1,157 @@ +== +``init`` Init Review Comment: yeah, i would put general description in the apps/system/init about what are possibilities here, and create dedicated page for nsh/init.d and nxinit :-) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] doc/system: Add documentation for NXInit [nuttx]
cederom commented on code in PR #18967: URL: https://github.com/apache/nuttx/pull/18967#discussion_r3307178171 ## Documentation/applications/system/init/index.rst: ## @@ -0,0 +1,157 @@ +== +``init`` Init Review Comment: this document fits nxinit best :-) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] doc/system: Add documentation for NXInit [nuttx]
linguini1 commented on code in PR #18967: URL: https://github.com/apache/nuttx/pull/18967#discussion_r3307062993 ## Documentation/applications/system/init/index.rst: ## @@ -0,0 +1,157 @@ +== +``init`` Init Review Comment: Shouldn't we call this NXInit? ## 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 [ ]* + + + ... + +- A Service is a program started by Init, with a unique name (can be overridden + via the override option). +- Options are modifiers for services, affecting their running mode and timing. + Examples include class (specify service category for batch start/stop), + override (override previously defined services), restart_period (interval + for restarting exited services), and reboot_on_failure (critical services + trigger device reboot on startup failure or abnormal exit). + +3. Imports +-- +Used to import other configuration files, supporting single files or all files +in a directory (non-recursive). + +.. code-block:: + +import + +In addition, since init.rc undergoes compiler preprocessing, we can also +include other configuration files during the preprocessing stage using +the #include directive. + +.. code-block:: + +#include "example.rc" Review Comment: How is this handled? I didn't see any tool for pre-processing called in the build process of the other PR? https://github.com/apache/nuttx-apps/pull/3504 ## 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 [ ]* + + + ... + +- A Service is a program started by Init, with a unique name (can be overridden + via the override option). +- Options are modifiers for services, affecting their running mode and timing. + Examples include class (specify service category for batch start/stop), + override (override previously defined services), restart_period (interval + for restarting exited services), and reboot_on_failure (critical services + trigger devic
