1d9f0492fSopenharmony_ci# init<a name="EN-US_TOPIC_0000001129033057"></a>
2d9f0492fSopenharmony_ci
3d9f0492fSopenharmony_ci-   [Introduction](#section469617221261)
4d9f0492fSopenharmony_ci-   [Directory Structure](#section15884114210197)
5d9f0492fSopenharmony_ci-   [Constraints](#section12212842173518)
6d9f0492fSopenharmony_ci-   [Usage](#section837771600)
7d9f0492fSopenharmony_ci-   [Repositories Involved](#section641143415335)
8d9f0492fSopenharmony_ci
9d9f0492fSopenharmony_ci## Introduction<a name="section469617221261"></a>
10d9f0492fSopenharmony_ci
11d9f0492fSopenharmony_ciThe init module starts system service processes from the time the kernel loads the first user-space process to the time the first application is started. In addition to loading key system processes, the module needs to configure their permissions during the startup and keep the specified process alive after sub-processes are started. If a process exits abnormally, the module needs to restart it, and to perform system reset for a special process.
12d9f0492fSopenharmony_ci
13d9f0492fSopenharmony_ci## Directory Structure<a name="section15884114210197"></a>
14d9f0492fSopenharmony_ci
15d9f0492fSopenharmony_ci```
16d9f0492fSopenharmony_cibase/startup/init/             # init module
17d9f0492fSopenharmony_ci├── LICENSE
18d9f0492fSopenharmony_ci└── services
19d9f0492fSopenharmony_ci    ├── include                  # Header files for the init module
20d9f0492fSopenharmony_ci    ├── src                      # Source files for the init module
21d9f0492fSopenharmony_ci    └── test                     # Source files of the test cases for the init module
22d9f0492fSopenharmony_ci        └── unittest
23d9f0492fSopenharmony_civendor
24d9f0492fSopenharmony_ci└──huawei
25d9f0492fSopenharmony_ci        └──camera
26d9f0492fSopenharmony_ci                └──init_configs  # init configuration files (in JSON format, and deployed in /etc/init.cfg after image burning)
27d9f0492fSopenharmony_ci```
28d9f0492fSopenharmony_ci
29d9f0492fSopenharmony_ci## Constraints<a name="section12212842173518"></a>
30d9f0492fSopenharmony_ci
31d9f0492fSopenharmony_ciCurrently, the init module applies only to small-system devices \(reference memory ≥ 1 MB\), for example, Hi3516D V300 and Hi3518E V300.
32d9f0492fSopenharmony_ci
33d9f0492fSopenharmony_ci## Usage<a name="section837771600"></a>
34d9f0492fSopenharmony_ci
35d9f0492fSopenharmony_ciinit divides the system startup into three phases:
36d9f0492fSopenharmony_ci
37d9f0492fSopenharmony_cipre-init: operations required before system services are started, for example, mounting a file system, creating a folder, and modifying permissions
38d9f0492fSopenharmony_ci
39d9f0492fSopenharmony_ciinit: operations required for starting system services.
40d9f0492fSopenharmony_ci
41d9f0492fSopenharmony_cipost-init: operations required after system services are started.
42d9f0492fSopenharmony_ci
43d9f0492fSopenharmony_ciIn the  **init.cfg**  file, each of the preceding phases is represented by a job, which corresponds to a command set. The init\_lite module initializes the system by executing the commands in each job in sequence. Jobs are executed in the following sequence: pre-init \> init \> post-init. All jobs are stored in the  **jobs**  array in the  **init.cfg**  file.
44d9f0492fSopenharmony_ci
45d9f0492fSopenharmony_ciIn addition to the  **jobs**  array, the  **init.cfg**  file also provides a  **services**  array, which is used to store the names, executable file paths, permissions, and other attribute information of the key system services that need to be started by the init process.
46d9f0492fSopenharmony_ci
47d9f0492fSopenharmony_ciThe file is stored in  **/vendor/hisilicon/hispark\_aries/init\_configs/**  under  **/etc/**. It is in JSON format, and its size cannot exceed 100 KB.
48d9f0492fSopenharmony_ci
49d9f0492fSopenharmony_ciThe format and content of the  **init.cfg**  file are as follows:
50d9f0492fSopenharmony_ci
51d9f0492fSopenharmony_ci```
52d9f0492fSopenharmony_ci{
53d9f0492fSopenharmony_ci    "jobs" : [{
54d9f0492fSopenharmony_ci            "name" : "pre-init",
55d9f0492fSopenharmony_ci            "cmds" : [
56d9f0492fSopenharmony_ci                "mkdir /testdir",
57d9f0492fSopenharmony_ci                "chmod 0700 /testdir",
58d9f0492fSopenharmony_ci                "chown 99 99 /testdir",
59d9f0492fSopenharmony_ci                "mkdir /testdir2",
60d9f0492fSopenharmony_ci                "mount vfat /dev/mmcblk0p0 /testdir2 noexec nosuid"
61d9f0492fSopenharmony_ci            ]
62d9f0492fSopenharmony_ci        }, {
63d9f0492fSopenharmony_ci            "name" : "init",
64d9f0492fSopenharmony_ci            "cmds" : [
65d9f0492fSopenharmony_ci                "start service1",
66d9f0492fSopenharmony_ci                "start service2"
67d9f0492fSopenharmony_ci             ]
68d9f0492fSopenharmony_ci        }, {
69d9f0492fSopenharmony_ci             "name" : "post-init",
70d9f0492fSopenharmony_ci             "cmds" : []
71d9f0492fSopenharmony_ci        }
72d9f0492fSopenharmony_ci    ],
73d9f0492fSopenharmony_ci    "services" : [{
74d9f0492fSopenharmony_ci            "name" : "service1",
75d9f0492fSopenharmony_ci            "path" : "/bin/process1",
76d9f0492fSopenharmony_ci            "uid" : 1,
77d9f0492fSopenharmony_ci            "gid" : 1,
78d9f0492fSopenharmony_ci            "secon" : "u:r:untrusted_app:s0",
79d9f0492fSopenharmony_ci            "once" : 0,
80d9f0492fSopenharmony_ci            "importance" : 1,
81d9f0492fSopenharmony_ci            "caps" : [0, 1, 2, 5]
82d9f0492fSopenharmony_ci    }, {
83d9f0492fSopenharmony_ci            "name" : "service2",
84d9f0492fSopenharmony_ci            "path" : "/bin/process2",
85d9f0492fSopenharmony_ci            "uid" : 2,
86d9f0492fSopenharmony_ci            "gid" : 2,
87d9f0492fSopenharmony_ci            "secon" : "u:r:untrusted_app:s0",
88d9f0492fSopenharmony_ci            "once" : 1,
89d9f0492fSopenharmony_ci            "importance" : 0,
90d9f0492fSopenharmony_ci            "caps" : []
91d9f0492fSopenharmony_ci        }
92d9f0492fSopenharmony_ci    ]
93d9f0492fSopenharmony_ci}
94d9f0492fSopenharmony_ci```
95d9f0492fSopenharmony_ci
96d9f0492fSopenharmony_ci**Table  1**  Job description
97d9f0492fSopenharmony_ci
98d9f0492fSopenharmony_ci<a name="table1801509284"></a>
99d9f0492fSopenharmony_ci<table><thead align="left"><tr id="row680703289"><th class="cellrowborder" valign="top" width="13.4%" id="mcps1.2.3.1.1"><p id="p11805012282"><a name="p11805012282"></a><a name="p11805012282"></a>Job Name</p>
100d9f0492fSopenharmony_ci</th>
101d9f0492fSopenharmony_ci<th class="cellrowborder" valign="top" width="86.6%" id="mcps1.2.3.1.2"><p id="p2811605289"><a name="p2811605289"></a><a name="p2811605289"></a>Description</p>
102d9f0492fSopenharmony_ci</th>
103d9f0492fSopenharmony_ci</tr>
104d9f0492fSopenharmony_ci</thead>
105d9f0492fSopenharmony_ci<tbody><tr id="row178140112810"><td class="cellrowborder" valign="top" width="13.4%" headers="mcps1.2.3.1.1 "><p id="p6811809281"><a name="p6811809281"></a><a name="p6811809281"></a>pre-init</p>
106d9f0492fSopenharmony_ci</td>
107d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="86.6%" headers="mcps1.2.3.1.2 "><p id="p18115019284"><a name="p18115019284"></a><a name="p18115019284"></a>Job that is executed first. Operations (for example, creating a folder) required before the process startup are executed in this job.</p>
108d9f0492fSopenharmony_ci</td>
109d9f0492fSopenharmony_ci</tr>
110d9f0492fSopenharmony_ci<tr id="row381120182817"><td class="cellrowborder" valign="top" width="13.4%" headers="mcps1.2.3.1.1 "><p id="p148116002812"><a name="p148116002812"></a><a name="p148116002812"></a>init</p>
111d9f0492fSopenharmony_ci</td>
112d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="86.6%" headers="mcps1.2.3.1.2 "><p id="p14818016288"><a name="p14818016288"></a><a name="p14818016288"></a>Job that is executed in between. Operations (for example, service startup) are executed in this job.</p>
113d9f0492fSopenharmony_ci</td>
114d9f0492fSopenharmony_ci</tr>
115d9f0492fSopenharmony_ci<tr id="row181100162813"><td class="cellrowborder" valign="top" width="13.4%" headers="mcps1.2.3.1.1 "><p id="p3811804281"><a name="p3811804281"></a><a name="p3811804281"></a>post-init</p>
116d9f0492fSopenharmony_ci</td>
117d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="86.6%" headers="mcps1.2.3.1.2 "><p id="p18116016285"><a name="p18116016285"></a><a name="p18116016285"></a>Job that is finally executed. Operations (for example, mounting the device after the driver initialization) required after the process startup are executed in this job.</p>
118d9f0492fSopenharmony_ci</td>
119d9f0492fSopenharmony_ci</tr>
120d9f0492fSopenharmony_ci</tbody>
121d9f0492fSopenharmony_ci</table>
122d9f0492fSopenharmony_ci
123d9f0492fSopenharmony_ciA single job can hold a maximum of 30 commands \(only  **start**,  **mkdir**,  **chmod**,  **chown**,  **mount**, and  **loadcfg**  are supported currently\). The command name and parameters \(128 bytes or less\) must be separated by only one space.
124d9f0492fSopenharmony_ci
125d9f0492fSopenharmony_ci**Table  2**  Commands supported by a job
126d9f0492fSopenharmony_ci
127d9f0492fSopenharmony_ci<a name="table122681439144112"></a>
128d9f0492fSopenharmony_ci<table><thead align="left"><tr id="row826873984116"><th class="cellrowborder" valign="top" width="10.15%" id="mcps1.2.4.1.1"><p id="p826833919412"><a name="p826833919412"></a><a name="p826833919412"></a>Command</p>
129d9f0492fSopenharmony_ci</th>
130d9f0492fSopenharmony_ci<th class="cellrowborder" valign="top" width="34.089999999999996%" id="mcps1.2.4.1.2"><p id="p3381142134118"><a name="p3381142134118"></a><a name="p3381142134118"></a>Format and Example</p>
131d9f0492fSopenharmony_ci</th>
132d9f0492fSopenharmony_ci<th class="cellrowborder" valign="top" width="55.76%" id="mcps1.2.4.1.3"><p id="p1268539154110"><a name="p1268539154110"></a><a name="p1268539154110"></a>Description</p>
133d9f0492fSopenharmony_ci</th>
134d9f0492fSopenharmony_ci</tr>
135d9f0492fSopenharmony_ci</thead>
136d9f0492fSopenharmony_ci<tbody><tr id="row142681039124116"><td class="cellrowborder" valign="top" width="10.15%" headers="mcps1.2.4.1.1 "><p id="p2083714604313"><a name="p2083714604313"></a><a name="p2083714604313"></a>mkdir</p>
137d9f0492fSopenharmony_ci</td>
138d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="34.089999999999996%" headers="mcps1.2.4.1.2 "><p id="p143811842154111"><a name="p143811842154111"></a><a name="p143811842154111"></a>mkdir <em id="i59061027135319"><a name="i59061027135319"></a><a name="i59061027135319"></a>target folder</em></p>
139d9f0492fSopenharmony_ci<p id="p4377174213435"><a name="p4377174213435"></a><a name="p4377174213435"></a>Example: mkdir /storage/myDirectory</p>
140d9f0492fSopenharmony_ci</td>
141d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="55.76%" headers="mcps1.2.4.1.3 "><p id="p56817536457"><a name="p56817536457"></a><a name="p56817536457"></a>Creates a folder. <strong id="b1111653719537"><a name="b1111653719537"></a><a name="b1111653719537"></a>mkdir</strong> and the target folder must be separated by only one space.</p>
142d9f0492fSopenharmony_ci</td>
143d9f0492fSopenharmony_ci</tr>
144d9f0492fSopenharmony_ci<tr id="row1268133919413"><td class="cellrowborder" valign="top" width="10.15%" headers="mcps1.2.4.1.1 "><p id="p97961563461"><a name="p97961563461"></a><a name="p97961563461"></a>chmod</p>
145d9f0492fSopenharmony_ci</td>
146d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="34.089999999999996%" headers="mcps1.2.4.1.2 "><p id="p20381144234118"><a name="p20381144234118"></a><a name="p20381144234118"></a>chmod <em id="i15124416538"><a name="i15124416538"></a><a name="i15124416538"></a>permission</em> <em id="i1056644195314"><a name="i1056644195314"></a><a name="i1056644195314"></a>target</em></p>
147d9f0492fSopenharmony_ci<p id="p6334213124413"><a name="p6334213124413"></a><a name="p6334213124413"></a>Examples: chmod 0600 /storage/myFile.txt</p>
148d9f0492fSopenharmony_ci<p id="p1748214543444"><a name="p1748214543444"></a><a name="p1748214543444"></a>chmod 0750 /storage/myDir</p>
149d9f0492fSopenharmony_ci</td>
150d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="55.76%" headers="mcps1.2.4.1.3 "><p id="p2023822074614"><a name="p2023822074614"></a><a name="p2023822074614"></a>Modifies the permission, which must be in the <strong id="b8112193214139"><a name="b8112193214139"></a><a name="b8112193214139"></a>0<em id="i11455534181314"><a name="i11455534181314"></a><a name="i11455534181314"></a>xxx</em></strong> format. <strong id="b2675148175310"><a name="b2675148175310"></a><a name="b2675148175310"></a>chmod</strong>, <em id="i46798488538"><a name="i46798488538"></a><a name="i46798488538"></a>permission</em>, and <em id="i667944825318"><a name="i667944825318"></a><a name="i667944825318"></a>target</em> must be separated by only one space.</p>
151d9f0492fSopenharmony_ci</td>
152d9f0492fSopenharmony_ci</tr>
153d9f0492fSopenharmony_ci<tr id="row7268143918416"><td class="cellrowborder" valign="top" width="10.15%" headers="mcps1.2.4.1.1 "><p id="p8255346174610"><a name="p8255346174610"></a><a name="p8255346174610"></a>chown</p>
154d9f0492fSopenharmony_ci</td>
155d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="34.089999999999996%" headers="mcps1.2.4.1.2 "><p id="p238114423418"><a name="p238114423418"></a><a name="p238114423418"></a>chown uid gid <em id="i161565145312"><a name="i161565145312"></a><a name="i161565145312"></a>target</em></p>
156d9f0492fSopenharmony_ci<p id="p1118592184518"><a name="p1118592184518"></a><a name="p1118592184518"></a>Example: chown 900 800 /storage/myDir</p>
157d9f0492fSopenharmony_ci<p id="p1235374884510"><a name="p1235374884510"></a><a name="p1235374884510"></a>chown 100 100 /storage/myFile.txt</p>
158d9f0492fSopenharmony_ci</td>
159d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="55.76%" headers="mcps1.2.4.1.3 "><p id="p18408185817467"><a name="p18408185817467"></a><a name="p18408185817467"></a>Modifies the owner group. <strong id="b19641958195310"><a name="b19641958195310"></a><a name="b19641958195310"></a>chown</strong>, <strong id="b15698584534"><a name="b15698584534"></a><a name="b15698584534"></a>uid</strong>, <strong id="b1692058135310"><a name="b1692058135310"></a><a name="b1692058135310"></a>gid</strong>, and <em id="i56935885316"><a name="i56935885316"></a><a name="i56935885316"></a>target</em> must be separated by only one space.</p>
160d9f0492fSopenharmony_ci</td>
161d9f0492fSopenharmony_ci</tr>
162d9f0492fSopenharmony_ci<tr id="row109751379478"><td class="cellrowborder" valign="top" width="10.15%" headers="mcps1.2.4.1.1 "><p id="p1017823174717"><a name="p1017823174717"></a><a name="p1017823174717"></a>mount</p>
163d9f0492fSopenharmony_ci</td>
164d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="34.089999999999996%" headers="mcps1.2.4.1.2 "><p id="p10381124244117"><a name="p10381124244117"></a><a name="p10381124244117"></a>mount fileSystemType src dst flags data</p>
165d9f0492fSopenharmony_ci<p id="p572019493485"><a name="p572019493485"></a><a name="p572019493485"></a>Example: mount vfat /dev/mmcblk0 /sdc rw,umask=000</p>
166d9f0492fSopenharmony_ci<p id="p7381173625313"><a name="p7381173625313"></a><a name="p7381173625313"></a>mount jffs2 /dev/mtdblock3 /storage nosuid</p>
167d9f0492fSopenharmony_ci</td>
168d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="55.76%" headers="mcps1.2.4.1.3 "><p id="p11976107144710"><a name="p11976107144710"></a><a name="p11976107144710"></a>Mounts devices. Every two parameters must be separated by only one space. Currently, supported flags include <strong id="b5512525411"><a name="b5512525411"></a><a name="b5512525411"></a>nodev</strong>, <strong id="b41014514541"><a name="b41014514541"></a><a name="b41014514541"></a>noexec</strong>, <strong id="b5101152543"><a name="b5101152543"></a><a name="b5101152543"></a>nosuid</strong>, <strong id="b20103555419"><a name="b20103555419"></a><a name="b20103555419"></a>rdonly</strong>, and optionally <strong id="b41045175420"><a name="b41045175420"></a><a name="b41045175420"></a>data</strong>.</p>
169d9f0492fSopenharmony_ci</td>
170d9f0492fSopenharmony_ci</tr>
171d9f0492fSopenharmony_ci<tr id="row1334911198482"><td class="cellrowborder" valign="top" width="10.15%" headers="mcps1.2.4.1.1 "><p id="p1214153117480"><a name="p1214153117480"></a><a name="p1214153117480"></a>start</p>
172d9f0492fSopenharmony_ci</td>
173d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="34.089999999999996%" headers="mcps1.2.4.1.2 "><p id="p133816420411"><a name="p133816420411"></a><a name="p133816420411"></a>start serviceName</p>
174d9f0492fSopenharmony_ci<p id="p2036714132541"><a name="p2036714132541"></a><a name="p2036714132541"></a>Example: start foundation</p>
175d9f0492fSopenharmony_ci<p id="p115951820185412"><a name="p115951820185412"></a><a name="p115951820185412"></a>start shell</p>
176d9f0492fSopenharmony_ci</td>
177d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="55.76%" headers="mcps1.2.4.1.3 "><p id="p4350121915488"><a name="p4350121915488"></a><a name="p4350121915488"></a>Starts services. <em id="i87951116544"><a name="i87951116544"></a><a name="i87951116544"></a>serviceName</em> must be contained in the <strong id="b379981145417"><a name="b379981145417"></a><a name="b379981145417"></a>services</strong> array.</p>
178d9f0492fSopenharmony_ci</td>
179d9f0492fSopenharmony_ci</tr>
180d9f0492fSopenharmony_ci<tr id="row96921442712"><td class="cellrowborder" valign="top" width="10.15%" headers="mcps1.2.4.1.1 "><p id="p1693642018"><a name="p1693642018"></a><a name="p1693642018"></a>loadcfg</p>
181d9f0492fSopenharmony_ci</td>
182d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="34.089999999999996%" headers="mcps1.2.4.1.2 "><p id="p1969364211116"><a name="p1969364211116"></a><a name="p1969364211116"></a>loadcfg filePath</p>
183d9f0492fSopenharmony_ci<p id="p1858112368211"><a name="p1858112368211"></a><a name="p1858112368211"></a>Example: loadcfg /patch/fstab.cfg</p>
184d9f0492fSopenharmony_ci</td>
185d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="55.76%" headers="mcps1.2.4.1.3 "><p id="p13986141320510"><a name="p13986141320510"></a><a name="p13986141320510"></a>Loads other <strong id="b280561515549"><a name="b280561515549"></a><a name="b280561515549"></a>.cfg</strong> files. The maximum size of the target file (only <strong id="b105471717135416"><a name="b105471717135416"></a><a name="b105471717135416"></a>/patch/fstab.cfg</strong> supported currently) is 50 KB. Each line in the <strong id="b14853122910540"><a name="b14853122910540"></a><a name="b14853122910540"></a>/patch/fstab.cfg</strong> file is a command. The command types and formats must comply with their respective requirements mentioned in this table. A maximum of 20 commands are allowed.</p>
186d9f0492fSopenharmony_ci</td>
187d9f0492fSopenharmony_ci</tr>
188d9f0492fSopenharmony_ci</tbody>
189d9f0492fSopenharmony_ci</table>
190d9f0492fSopenharmony_ci
191d9f0492fSopenharmony_ci**Table  3**  Elements in the  **services**  array
192d9f0492fSopenharmony_ci
193d9f0492fSopenharmony_ci<a name="table14737791471"></a>
194d9f0492fSopenharmony_ci<table><thead align="left"><tr id="row273839577"><th class="cellrowborder" valign="top" width="10.37%" id="mcps1.2.3.1.1"><p id="p107382095711"><a name="p107382095711"></a><a name="p107382095711"></a>Field</p>
195d9f0492fSopenharmony_ci</th>
196d9f0492fSopenharmony_ci<th class="cellrowborder" valign="top" width="89.63%" id="mcps1.2.3.1.2"><p id="p17738189277"><a name="p17738189277"></a><a name="p17738189277"></a>Description</p>
197d9f0492fSopenharmony_ci</th>
198d9f0492fSopenharmony_ci</tr>
199d9f0492fSopenharmony_ci</thead>
200d9f0492fSopenharmony_ci<tbody><tr id="row17386911716"><td class="cellrowborder" valign="top" width="10.37%" headers="mcps1.2.3.1.1 "><p id="p17384912710"><a name="p17384912710"></a><a name="p17384912710"></a>name</p>
201d9f0492fSopenharmony_ci</td>
202d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="89.63%" headers="mcps1.2.3.1.2 "><p id="p1173818913714"><a name="p1173818913714"></a><a name="p1173818913714"></a>Name of the current service. The value cannot be empty and can contain a maximum of 32 bytes.</p>
203d9f0492fSopenharmony_ci</td>
204d9f0492fSopenharmony_ci</tr>
205d9f0492fSopenharmony_ci<tr id="row1473810916714"><td class="cellrowborder" valign="top" width="10.37%" headers="mcps1.2.3.1.1 "><p id="p127381991571"><a name="p127381991571"></a><a name="p127381991571"></a>path</p>
206d9f0492fSopenharmony_ci</td>
207d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="89.63%" headers="mcps1.2.3.1.2 "><p id="p1073815910717"><a name="p1073815910717"></a><a name="p1073815910717"></a>Full path (including parameters) of the executable file for the current service. This is an array. Ensure that the first element is the path of the executable file, the maximum number of elements is 20, and each element is a string that contains a maximum of 64 bytes.</p>
208d9f0492fSopenharmony_ci</td>
209d9f0492fSopenharmony_ci</tr>
210d9f0492fSopenharmony_ci<tr id="row77381291271"><td class="cellrowborder" valign="top" width="10.37%" headers="mcps1.2.3.1.1 "><p id="p77381391770"><a name="p77381391770"></a><a name="p77381391770"></a>uid</p>
211d9f0492fSopenharmony_ci</td>
212d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="89.63%" headers="mcps1.2.3.1.2 "><p id="p107387920711"><a name="p107387920711"></a><a name="p107387920711"></a>User ID (UID) of the current service process.</p>
213d9f0492fSopenharmony_ci</td>
214d9f0492fSopenharmony_ci</tr>
215d9f0492fSopenharmony_ci<tr id="row127381591673"><td class="cellrowborder" valign="top" width="10.37%" headers="mcps1.2.3.1.1 "><p id="p47388919715"><a name="p47388919715"></a><a name="p47388919715"></a>gid</p>
216d9f0492fSopenharmony_ci</td>
217d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="89.63%" headers="mcps1.2.3.1.2 "><p id="p12738691479"><a name="p12738691479"></a><a name="p12738691479"></a>Group ID (GID) of the current service process.</p>
218d9f0492fSopenharmony_ci</td>
219d9f0492fSopenharmony_ci</tr>
220d9f0492fSopenharmony_ci<tr id="row127381591693"><td class="cellrowborder" valign="top" width="10.37%" headers="mcps1.2.3.1.1 "><p id="p47388919793"><a name="p47388919793"></a><a name="p47388919715"></a>secon</p>
221d9f0492fSopenharmony_ci</td>
222d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="89.63%" headers="mcps1.2.3.1.2 "><p id="p12738691493"><a name="p12738691493"></a><a name="p12738691493"></a>Security context of the current service process (no need to set currently).</p>
223d9f0492fSopenharmony_ci</td>
224d9f0492fSopenharmony_ci</tr>
225d9f0492fSopenharmony_ci<tr id="row188301014171116"><td class="cellrowborder" valign="top" width="10.37%" headers="mcps1.2.3.1.1 "><p id="p183112146115"><a name="p183112146115"></a><a name="p183112146115"></a>once</p>
226d9f0492fSopenharmony_ci</td>
227d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="89.63%" headers="mcps1.2.3.1.2 "><p id="p18548317195715"><a name="p18548317195715"></a><a name="p18548317195715"></a>Whether the current service process is a one-off process.</p>
228d9f0492fSopenharmony_ci<p id="p103571840105812"><a name="p103571840105812"></a><a name="p103571840105812"></a><strong id="b7898115614817"><a name="b7898115614817"></a><a name="b7898115614817"></a>1</strong>: The current service process is a one-off process. If the process exits, the init process does not restart it.</p>
229d9f0492fSopenharmony_ci<p id="p5831191431116"><a name="p5831191431116"></a><a name="p5831191431116"></a><strong id="b20971155820811"><a name="b20971155820811"></a><a name="b20971155820811"></a>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.</p>
230d9f0492fSopenharmony_ci<p id="p378912714010"><a name="p378912714010"></a><a name="p378912714010"></a>Note: If a non-one-off process exits for five consecutive times within four minutes, the init process will no longer restart it at the fifth exit.</p>
231d9f0492fSopenharmony_ci</td>
232d9f0492fSopenharmony_ci</tr>
233d9f0492fSopenharmony_ci<tr id="row386110321155"><td class="cellrowborder" valign="top" width="10.37%" headers="mcps1.2.3.1.1 "><p id="p14861113212156"><a name="p14861113212156"></a><a name="p14861113212156"></a>importance</p>
234d9f0492fSopenharmony_ci</td>
235d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="89.63%" headers="mcps1.2.3.1.2 "><p id="p166448210816"><a name="p166448210816"></a><a name="p166448210816"></a>Whether the current service process is a key system process.</p>
236d9f0492fSopenharmony_ci<p id="p8572182712811"><a name="p8572182712811"></a><a name="p8572182712811"></a><strong id="b72917915010"><a name="b72917915010"></a><a name="b72917915010"></a>0</strong>: The current service process is not a key system process. If it exits, the init process does not reset or restart the system.</p>
237d9f0492fSopenharmony_ci<p id="p11861032111516"><a name="p11861032111516"></a><a name="p11861032111516"></a><strong id="b1074320101309"><a name="b1074320101309"></a><a name="b1074320101309"></a>1</strong>: The current service process is a key system process. If it exits, the init process resets and restarts the system.</p>
238d9f0492fSopenharmony_ci</td>
239d9f0492fSopenharmony_ci</tr>
240d9f0492fSopenharmony_ci<tr id="row1689310618179"><td class="cellrowborder" valign="top" width="10.37%" headers="mcps1.2.3.1.1 "><p id="p108931367177"><a name="p108931367177"></a><a name="p108931367177"></a>caps</p>
241d9f0492fSopenharmony_ci</td>
242d9f0492fSopenharmony_ci<td class="cellrowborder" valign="top" width="89.63%" headers="mcps1.2.3.1.2 "><p id="p489313618173"><a name="p489313618173"></a><a name="p489313618173"></a>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. Currently, a maximum of 100 values can be configured.</p>
243d9f0492fSopenharmony_ci</td>
244d9f0492fSopenharmony_ci</tr>
245d9f0492fSopenharmony_ci</tbody>
246d9f0492fSopenharmony_ci</table>
247d9f0492fSopenharmony_ci
248d9f0492fSopenharmony_ci## Repositories Involved<a name="section641143415335"></a>
249d9f0492fSopenharmony_ci
250d9f0492fSopenharmony_ci[Startup subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/startup.md)
251d9f0492fSopenharmony_ci
252d9f0492fSopenharmony_ci[startup\_syspara\_lite](https://gitee.com/openharmony/startup_syspara_lite/blob/master/README.md)
253d9f0492fSopenharmony_ci
254d9f0492fSopenharmony_ci[startup\_appspawn\_lite](https://gitee.com/openharmony/startup_appspawn_lite/blob/master/README.md)
255d9f0492fSopenharmony_ci
256d9f0492fSopenharmony_ci[startup\_bootstrap\_lite](https://gitee.com/openharmony/startup_bootstrap_lite/blob/master/README.md)
257d9f0492fSopenharmony_ci
258d9f0492fSopenharmony_ci**[startup\_init\_lite]**
259d9f0492fSopenharmony_ci
260