提交 7bd685bf 编写于 作者: S shawn_he

update doc

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 41fc1d0e
# Job Management # Job Management
## Overview ## Overview
### Kconfig Visual Configuration ### Overview
A job is a set of commands in the **.cfg** file of the init module. A maximum of 4096 jobs can be added. Jobs can be configured in the [.cfg file](subsys-boot-init-cfg.md). Generally, jobs are executed during initialization to serve the normal startup of services or the initialization of specific basic functions. A job is a set of commands in the **.cfg** file of the init module. A maximum of 4096 jobs can be added. Jobs can be configured in the [.cfg file](subsys-boot-init-cfg.md). Generally, jobs are executed during initialization to serve the normal startup of services or the initialization of specific basic functions.
### Basic Concepts ### Basic Concepts
...@@ -99,7 +99,7 @@ Job management is a part of the init startup process. It is a process-based func ...@@ -99,7 +99,7 @@ Job management is a part of the init startup process. It is a process-based func
|static void SendTriggerEvent(int type, const char *content, uint32_t contentLen)|Performs functions such as system control and starting or stopping of services based on system parameters.| Standard system| |static void SendTriggerEvent(int type, const char *content, uint32_t contentLen)|Performs functions such as system control and starting or stopping of services based on system parameters.| Standard system|
|static void DoTriggerCmd(const struct CmdArgs *ctx)|Executes the <strong>trigger</strong> command.| Standard system| |static void DoTriggerCmd(const struct CmdArgs *ctx)|Executes the <strong>trigger</strong> command.| Standard system|
|void DoTriggerExec(const char *triggerName)| Finds a command group based on the job name and pushes the commands in the command group to the execution queue.| Standard system| |void DoTriggerExec(const char *triggerName)| Finds a command group based on the job name and pushes the commands in the command group to the execution queue.| Standard system|
|void DoJob(const char *jobName)|Matches a job based on the job name and invokes <strong>DoCmdByIndex</strong><br>to execute the commands in the job.| Small system| |void DoJob(const char *jobName)|Matches a job based on the job name and invokes <strong>DoCmdByIndex</strong> to execute the commands in the job.| Small system|
|void DoCmdByIndex(int index, const char *cmdContent)|Combines parameters and commands.| Small and standard systems| |void DoCmdByIndex(int index, const char *cmdContent)|Combines parameters and commands.| Small and standard systems|
### Development Example ### Development Example
......
...@@ -59,7 +59,7 @@ bootchart is available only for the standard system, and begetctl is available f ...@@ -59,7 +59,7 @@ bootchart is available only for the standard system, and begetctl is available f
### Available APIs ### Available APIs
**Table 1** Description of APIs<a name="table14737791479"></a> **Table 1** Description of plug-in management APIs<a name="table14737791479"></a>
| API| Description| | API| Description|
| ---------- | ---------- | | ---------- | ---------- |
| void PluginExecCmdByName(const char *name, const char *cmdContent) | Starts a plug-in by name.| | void PluginExecCmdByName(const char *name, const char *cmdContent) | Starts a plug-in by name.|
...@@ -87,7 +87,7 @@ bootchart is available only for the standard system, and begetctl is available f ...@@ -87,7 +87,7 @@ bootchart is available only for the standard system, and begetctl is available f
MODULE_CONSTRUCTOR(void) MODULE_CONSTRUCTOR(void)
{ {
// Depends on parameter service // Depending on parameter service
InitAddPostPersistParamLoadHook(0, bootchartEarlyHook); InitAddPostPersistParamLoadHook(0, bootchartEarlyHook);
} }
``` ```
......
...@@ -115,23 +115,23 @@ By parsing the <strong>*.cfg</strong> file, you can obtain **service** fields, a ...@@ -115,23 +115,23 @@ By parsing the <strong>*.cfg</strong> file, you can obtain **service** fields, a
### Parameters ### Parameters
**Table 1** Description of service fields<a name="table14737791471"></a> **Table 1** Description of service fields<a name="table14737791471"></a>
| Name| Supported System Type| Description| Remarks| | Name| Meaning| Description| Supported System Type|
| ---------- |-------- | --------| --------| | ---------- |-------- | --------| --------|
| name | Small and standard systems | Name of the current service. (Mandatory)| Type: string. The value cannot be empty and can contain a maximum of 32 bytes.| | name | Name of the current service. (Mandatory)| Type: string. The value cannot be empty and can contain a maximum of 32 bytes.| Small and standard systems |
| path | Small and standard systems| Full path (including parameters) of the executable file for the current service. This is an array. (Mandatory)| The first element is the path of the executable file, and the maximum number of elements is 20.<br> Each element is a string that contains a maximum of 64 bytes.| | path | Full path (including parameters) of the executable file for the current service. This is an array. (Mandatory)| The first element is the path of the executable file, and the maximum number of elements is 20.<br> Each element is a string that contains a maximum of 64 bytes.| Small and standard systems|
| uid | Small and standard systems| User ID (UID) of the current service process.| Type: int or string.| | uid | User ID (UID) of the current service process.| Type: int or string.| Small and standard systems|
| gid | Small and standard systems| Group ID (GID) of the current service process.| Type: int, int[], string, or string array.| | gid | Group ID (GID) of the current service process.| Type: int, int[], string, or string array.| Small and standard systems|
| once | Small and standard systems| Whether the current service process is a one-off process.| <strong>1</strong>: The current service process is a one-off process. If the process exits, the init process does not restart it.<br><strong>0</strong>: The current service process is not a one-off process. If the process exits, the init process restarts it upon receiving the SIGCHLD signal.| | once | Whether the current service process is a one-off process.| <strong>1</strong>: The current service process is a one-off process. If the process exits, the init process does not restart it.<br><strong>0</strong>: The current service process is not a one-off process. If the process exits, the init process restarts it upon receiving the SIGCHLD signal.| Small and standard systems|
| importance | Small and standard systems| <br>Standard system: service priority<br>Small system: service importance| <br>Standard system: The service priority ranges from -20 to 19. A value beyond the range is invalid.<br>Small system: The value <strong>0</strong> indicates an unimportant process and a value greater than <strong>0</strong> indicates an important process.| | importance | Standard system: service priority<br>Small system: service importance| <br>Standard system: The service priority ranges from -20 to 19. A value beyond the range is invalid.<br>Small system: The value <strong>0</strong> indicates an unimportant process and a value greater than <strong>0</strong> indicates an important process.| Small and standard systems|
| caps | Small and standard systems| Capabilities required by the current service. They are evaluated based on the capabilities supported by the security subsystem and configured in accordance with the principle of least permission.| Type: number or string array. If you set the value to a number, use the standard Linux capability. If you set the value to a string array, use the standard macro name.| | caps | Capabilities required by the current service. They are evaluated based on the capabilities supported by the security subsystem and configured in accordance with the principle of least permission.| Type: number or string array. If you set the value to a number, use the standard Linux capability. If you set the value to a string array, use the standard macro name.| Small and standard systems|
| critical | Standard system| Suppression mechanism for services. If the number of times a service is restarted exceeds the value N within the specified period T, the system will be restarted.| <br>Standard system:<br>Type: int array, for example, <strong>"critical": [M, N, T]</strong>.<br>- <strong>M</strong>: enable flag (<strong>0</strong>: disable; <strong>1</strong>: enable).<br>- <strong>N</strong>: number of times the service is started.<br>- <strong>T</strong>: period of time, in seconds.<br> Both <strong>M</strong> and <strong>N</strong> are greater than <strong>0</strong>.<br> Small and standard systems:<br>Type: int, for example, <strong>"critical": M</strong>.<br><strong>M</strong>: enable flag (<strong>0</strong>: disable; <strong>1</strong>: enable).<br> By default, <strong>N</strong> is <strong>4</strong> and <strong>T</strong> is <strong>20</strong>.| | critical | Suppression mechanism for services. If the number of times a service is restarted exceeds the value N within the specified period T, the system will be restarted.| <br>Standard system:<br>Type: int array, for example, <strong>"critical": [M, N, T]</strong>.<br>- <strong>M</strong>: enable flag (<strong>0</strong>: disable; <strong>1</strong>: enable).<br>- <strong>N</strong>: number of times the service is started.<br>- <strong>T</strong>: period of time, in seconds.<br> Both <strong>M</strong> and <strong>N</strong> are greater than <strong>0</strong>.<br> Small and standard systems:<br>Type: int, for example, <strong>"critical": M</strong>.<br><strong>M</strong>: enable flag (<strong>0</strong>: disable; <strong>1</strong>: enable).<br> By default, <strong>N</strong> is <strong>4</strong> and <strong>T</strong> is <strong>20</strong>.| Standard system|
| cpucore | Standard system| Number of CPU cores bound to the service.| Type: int array, for example, <strong>"cpucore": [N1, N2, ...]</strong>. <strong>N1</strong> and <strong>N2</strong> indicate the indices of the CPU cores to be bound. For a single-core device, <strong>cpucore</strong> is <strong>0</strong>.| | cpucore | Number of CPU cores bound to the service.| Type: int array, for example, <strong>"cpucore": [N1, N2, ...]</strong>. <strong>N1</strong> and <strong>N2</strong> indicate the indices of the CPU cores to be bound. For a single-core device, <strong>cpucore</strong> is <strong>0</strong>.| Standard system|
| d-caps | Standard system| Distributed service capability.| Type: string array, for example, <strong>"d-caps": ["OHOS_DMS"]</strong>.| | d-caps | Distributed service capability.| Type: string array, for example, <strong>"d-caps": ["OHOS_DMS"]</strong>.| Standard system|
| apl | Standard system| Ability privilege level.| Type: string, for example, <strong>"apl": "system_core"</strong>.<br> The value can be <strong>system_core</strong> (default), <strong>normal</strong>, or <strong>system_basic</strong>.| | apl | Ability privilege level.| Type: string, for example, <strong>"apl": "system_core"</strong>.<br> The value can be <strong>system_core</strong> (default), <strong>normal</strong>, or <strong>system_basic</strong>.| Standard system|
| start-mode | Standard system| Service startup mode.| Type: string, for example, **"start-mode": "condition"**.<br>The value can be <strong>boot</strong>, <strong>normal</strong>, or <strong>condition</strong>. For details, see [init service startup control](#section56901555918).| | start-mode | Service startup mode.| Type: string, for example, **"start-mode": "condition"**.<br>The value can be <strong>boot</strong>, <strong>normal</strong>, or <strong>condition</strong>. For details, see [init service startup control](#section56901555918).| Standard system|
| ondemand | Small and standard systems| Whether on-demand startup is enabled.| Type: bool, for example, **"ondemand": true**. For small systems, this feature is available only on the Linux kernel.<br>For details, see [init Service On-Demand Startup](#section56901555920).| | ondemand | Whether on-demand startup is enabled.| Type: bool, for example, **"ondemand": true**. For small systems, this feature is available only on the Linux kernel.<br>For details, see [init Service On-Demand Startup](#section56901555920).| Small and standard systems|
| disable | Small and standard systems| Reserved.| None.| | disable | Reserved.| None.| Small and standard systems|
| sandbox | Standard system| Whether the sandbox function is enabled.| <strong>1</strong> (default): Enable the sandbox function.<br><strong>0</strong>: Disable the sandbox function.| | sandbox | Whether the sandbox function is enabled.| <strong>1</strong> (default): Enable the sandbox function.<br><strong>0</strong>: Disable the sandbox function.| Standard system|
**Table 2** Description of socket fields **Table 2** Description of socket fields
| Name| Description| | Name| Description|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册