• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Job Management
2## Overview
3### Function
4A 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.
5
6### Basic Concepts
7A job can be configured in the **init.cfg** file or the custom **.cfg** file of the module. The parser of the init process aggregates commands of the jobs with the same name into one job. For jobs with the same name, the init process only ensures that the commands in the **init.cfg** file are executed in preference. It does not guarantee the execution sequence of commands in other **.cfg** files.
8- Common job
9
10  A job executed in a fixed phase during init process startup, for example, pre-init, init, or post-init.
11  - pre-init: pre-initialization phase. Key services on which other services depend, such as ueventd, watchdog, and hilogd, are started in this phase. The mounting of data partitions is also done in this phase.
12  - init: main phase of the initialization process. In this phase, a large number of commands are executed, and services in the **boot** group (first group) are started concurrently by the **init** group. Some important services related to system functions are also started in this phase.
13  - post-init: post-initialization phase. In this phase, the **trigger** command is used to invoke the execution of other phases, which can be regarded as independent phases, or the post-init phase as a whole. In this phase, a large number of commands are executed, and the **normal** group (the second group) is started by the **init** group. Most services configured in the **.cfg** files are started in this phase.
14
15- Custom job (for standard system or higher)
16
17  A job triggered based on specific rules. You can add commands to the job as required and run the **trigger** command to invoke the execution of commands in the job.
18
19- Conditional job (for standard system or higher)
20
21  A job triggered based on specific conditions. You can add conditions to a job so that the job is executed when the conditions are met.
22
23  A condition is a combination of system parameter values and supports operations such as **&&** and **||**, for example, **"condition": "sys.usb.config = none && sys.usb.configfs = 0"**. When defining commands for a job, you can add attributes in the format of **param:xxx** to form different commands.
24
25### Constraints
26With the system parameter module, the standard system is able to support basic, conditional, and custom jobs. The small system supports only basic jobs.
27
28## How to Develop
29### Use Cases
30A job is a command set, where you can manage the commands to be executed. A maximum of 4096 commands can be added to a command set. During the init startup process, the execution of jobs helps ensure normal running of services.
31
32### Parameters
33
34   **Table 1** Command set description
35<table border="0" cellpadding="0" cellspacing="0" width="770" style="border-collapse: collapse;table-layout:fixed;width:578pt;border-spacing: 0px;font-variant-ligatures: normal; font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px; text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial">
36            <tbody>
37                <tr height="39" style="height:18.0pt">
38                    <th height="24" class="xl6521952" width="140" style="height:18.0pt;width:105pt">
39                        Command
40                    </td>
41                    <th class="xl6521952" width="215" style="border-left:none;width:161pt">
42                        Format and Example
43                    </td>
44                    <th class="xl6521952" width="225" style="border-left:none;width:169pt">
45                        Description
46                    </td>
47                    <th class="xl6521952" width="190" style="border-left:none;width:143pt">
48                        Supported System Type
49                    </td>
50                </tr>
51                <tr height="231" style="height:173.25pt">
52                    <td height="231" class="xl6621952" width="140" style="height:173.25pt;border-top: none;width:105pt">
53                        mkdir
54                    </td>
55                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
56                        mkdir <i>target folder</i> [mode] [owner] [group]<br>Example:<br>mkdir /storage/myDirectory<br>mkdir /storage/myDirectory 0755 root root
57                    </td>
58                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
59                        Creates a folder. <strong>mkdir</strong> and the target folder must be separated by only one space. Folders cannot be created recursively.
60                    </td>
61                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
62                        Small and standard systems
63                    </td>
64                </tr>
65                <tr height="277" style="mso-height-source:userset;height:207.75pt">
66                    <td height="277" class="xl6621952" width="140" style="height:207.75pt;border-top: none;width:105pt">
67                        chmod
68                    </td>
69                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
70                        chmod <i>permission</i> <i>target</i><br>Example:<br>chmod 0600 /storage/myFile.txt<br>chmod 0750 /storage/myDir
71                    </td>
72                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
73                        Modifies the permission, which must be in the <strong>0</strong><i>xxx</i> format. <strong>chmod</strong>, <i>permission</i>, and <i>target</i> must be separated by only one space.
74                    </td>
75                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
76                        Small and standard systems
77                    </td>
78                </tr>
79                <tr height="295" style="mso-height-source:userset;height:221.25pt">
80                    <td height="295" class="xl6621952" width="140" style="height:221.25pt;border-top: none;width:105pt">
81                        chown
82                    </td>
83                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
84                        chown <i>uid</i> <i>gid</i> <i>target</i><br>Example:<br>chown 900 800 /storage/myDir<br>chown 100 100 /storage/myFile.txt
85                    </td>
86                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
87                        Modifies the owner group. <strong>chown</strong>, <i>uid</i>, <i>gid</i>, and <i>target</i> must be separated by only one space.
88                    </td>
89                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
90                        Small and standard systems
91                    </td>
92                </tr>
93                <tr height="355" style="mso-height-source:userset;height:266.25pt">
94                    <td height="355" class="xl6621952" width="140" style="height:266.25pt;border-top: none;width:105pt">
95                        mount
96                    </td>
97                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
98                        mount fileSystemType src dst flags data<br>Example:<br>mount vfat /dev/mmcblk0 /sdc rw,umask=000<br>mount jffs2 /dev/mtdblock3 /storage nosuid
99                    </td>
100                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
101                        Mounts devices. Every two parameters must be separated by only one space. <br>For details about <strong>flags</strong>, see the <strong>mountFlagMap[]</strong> array of the <strong>mountFlagMap</strong> function in <strong>base/startup/init/services/init/init_common_cmds.c</strong>. The <strong>data</strong> field is optional.
102                    </td>
103                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
104                        Small and standard systems
105                    </td>
106                </tr>
107                <tr height="238" style="mso-height-source:userset;height:178.5pt">
108                    <td height="238" class="xl6621952" width="140" style="height:178.5pt;border-top: none;width:105pt">
109                        start
110                    </td>
111                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
112                        start <i>serviceName</i><br>Example:<br>start foundationstart
113                    </td>
114                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
115                        Starts services. <i>serviceName</i> must be contained in the <strong>services</strong> array.
116                    </td>
117                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
118                        Small and standard systems
119                    </td>
120                </tr>
121                <tr height="264" style="mso-height-source:userset;height:198.0pt">
122                    <td height="264" class="xl6621952" width="140" style="height:198.0pt;border-top: none;width:105pt">
123                        export
124                    </td>
125                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
126                        export <i>key value</i><br>Example:<br>export TEST /data/test
127                    </td>
128                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
129                        Sets environment variables. <i>key</i> and <i>value</i> respectively indicate the environment variable and its value.
130                    </td>
131                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
132                        Small and standard systems
133                    </td>
134                </tr>
135                <tr height="185" style="height:138.75pt">
136                    <td height="185" class="xl6621952" width="140" style="height:138.75pt;border-top: none;width:105pt">
137                        rm
138                    </td>
139                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
140                        rm <i>filename</i><br>Example:<br>rm /data/testfile
141                    </td>
142                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
143                        Deletes a file. <i>filename</i> indicates the absolute file path.
144                    </td>
145                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
146                        Small and standard systems
147                    </td>
148                </tr>
149                <tr height="185" style="height:138.75pt">
150                    <td height="185" class="xl6621952" width="140" style="height:138.75pt;border-top: none;width:105pt">
151                        rmdir
152                    </td>
153                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
154                        rmdir <i>dirname</i><br>Example:<br>rmdir /data/testdir
155                    </td>
156                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
157                        Deletes a directory. <i>dirname</i> indicates the absolute path of the directory.
158                    </td>
159                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
160                        Small and standard systems
161                    </td>
162                </tr>
163                <tr height="162" style="height:121.5pt">
164                    <td height="162" class="xl6621952" width="140" style="height:121.5pt;border-top: none;width:105pt">
165                        write
166                    </td>
167                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
168                        write filename value<br>Example:<br>write /data/testfile 0
169                    </td>
170                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
171                        Writes a file. <strong>filename</strong> and <strong>value</strong> respectively indicate the absolute file path and the string to write.
172                    </td>
173                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
174                        Standard system
175                    </td>
176                </tr>
177                <tr height="185" style="height:138.75pt">
178                    <td height="185" class="xl6621952" width="140" style="height:138.75pt;border-top: none;width:105pt">
179                        stop
180                    </td>
181                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
182                        stop <i>servicename</i><br>Example:<br>stop console
183                    </td>
184                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
185                        Stops a service. <i>servicename</i> indicates the name of the service to stop.
186                    </td>
187                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
188                        Small and standard systems
189                    </td>
190                </tr>
191                <tr height="280" style="mso-height-source:userset;height:210.0pt">
192                    <td height="280" class="xl6621952" width="140" style="height:210.0pt;border-top: none;width:105pt">
193                        copy
194                    </td>
195                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
196                        copy <i>oldfile</i> <i>newfile</i><br>Example:<br>copy /data/old /data/new
197                    </td>
198                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
199                        Copies a file. <i>oldfile</i> and <i>newfile</i> respectively indicate the old and new absolute file paths.
200                    </td>
201                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
202                        Small and standard systems
203                    </td>
204                </tr>
205                <tr height="382" style="mso-height-source:userset;height:286.5pt">
206                    <td height="382" class="xl6621952" width="140" style="height:286.5pt;border-top: none;width:105pt">
207                        reset
208                    </td>
209                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
210                        reset <i>servicename</i><br>Example:<br>reset console
211                    </td>
212                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
213                        Resets a service. <i>servicename</i> indicates the name of the service to reset. If the service has not been started, this command will start the service. If the service is running, the command will stop the service and then restart it.
214                    </td>
215                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
216                        Small and standard systems
217                    </td>
218                </tr>
219                <tr height="363" style="mso-height-source:userset;height:272.25pt">
220                    <td height="363" class="xl6621952" width="140" style="height:272.25pt;border-top: none;width:105pt">
221                        reboot
222                    </td>
223                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
224                        reboot <i>subsystem</i><br>Example:<br>reboot updater
225                    </td>
226                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
227                        Restarts the system. <i>subsystem</i> is optional. If it is not specified, the device enters the current system upon restarting. If it is specified, the device enters the corresponding subsystem upon restarting. For example, if you run <strong>reboot updater</strong>, the device enters the updater subsystem upon restarting.
228                    </td>
229                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
230                        Small and standard systems
231                    </td>
232                </tr>
233                <tr height="185" style="height:138.75pt">
234                    <td height="185" class="xl6621952" width="140" style="height:138.75pt;border-top: none;width:105pt">
235                        sleep
236                    </td>
237                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
238                        sleep <i>time</i><br>Example:<br>sleep 5
239                    </td>
240                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
241                        Enters the sleep mode. <i>time</i> indicates the sleep time. <br>To avoid impact on services, exercise caution when running this command.
242                    </td>
243                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
244                        Small and standard systems
245                    </td>
246                </tr>
247                <tr height="185" style="height:138.75pt">
248                    <td height="185" class="xl6621952" width="140" style="height:138.75pt;border-top: none;width:105pt">
249                        domainname
250                    </td>
251                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
252                        domainname <i>name</i><br>Example:<br>domainname localdomain
253                    </td>
254                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
255                        Sets the domain name.
256                    </td>
257                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
258                        Small and standard systems
259                    </td>
260                </tr>
261                <tr height="185" style="height:138.75pt">
262                    <td height="185" class="xl6621952" width="140" style="height:138.75pt;border-top: none;width:105pt">
263                        hostname
264                    </td>
265                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
266                        hostname <i>name</i><br>Example:<br>hostname localhost
267                    </td>
268                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
269                        Sets the host name.
270                    </td>
271                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
272                        Small and standard systems
273                    </td>
274                </tr>
275                <tr height="116" style="height:87.0pt">
276                    <td height="116" class="xl6621952" width="140" style="height:87.0pt;border-top: none;width:105pt">
277                        wait
278                    </td>
279                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
280                        wait <i>filepath</i><br>Example:<br>wait /data/testfile or wait /data/testfile 5
281                    </td>
282                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
283                        Waits for commands. The waiting time must not exceed 5 seconds.
284                    </td>
285                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
286                        Small and standard systems
287                    </td>
288                </tr>
289                <tr height="185" style="height:138.75pt">
290                    <td height="185" class="xl6621952" width="140" style="height:138.75pt;border-top: none;width:105pt">
291                        setrlimit
292                    </td>
293                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
294                        setrlimit resource <i>curValue</i> <i>maxValue</i><br>Example:<br>setrlimit RLIMIT_CPU 10 100
295                    </td>
296                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
297                        Sets resource usage restrictions. <br>For details, see the <strong>resource[]</strong> array of the <strong>DoSetrlimit</strong> function in <strong>base/startup/init/services/init/init_common_cmds.c</strong>.
298                    </td>
299                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
300                        Small and standard systems
301                    </td>
302                </tr>
303                <tr height="228" style="mso-height-source:userset;height:171.0pt">
304                    <td height="228" class="xl6621952" width="140" style="height:171.0pt;border-top: none;width:105pt">
305                        exec
306                    </td>
307                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
308                        exec <i>Path of the executable file</i> <i>Parameters passed by the executable file</i><br>Example:<br>exec /system/bin/udevadm trigger
309                    </td>
310                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
311                        Runs an executable file. The command must not contain more than 10 parameters.
312                    </td>
313                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
314                        Small and standard systems
315                    </td>
316                </tr>
317                <tr height="162" style="height:121.5pt">
318                    <td height="162" class="xl6621952" width="140" style="height:121.5pt;border-top: none;width:105pt">
319                        syncexec
320                    </td>
321                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
322                        syncexec <i>Path of the executable file</i> <i>Parameters passed by the executable file</i><br>Example:<br>syncexec /system/bin/udevadm trigger
323                    </td>
324                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
325                        Runs an executable file synchronously. The **wait** function will be called to wait for the child process to end. The command must not contain more than 10 parameters.
326                    </td>
327                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
328                        Standard system
329                    </td>
330                </tr>
331                <tr height="231" style="height:173.25pt">
332                    <td height="231" class="xl6621952" width="140" style="height:173.25pt;border-top: none;width:105pt">
333                        mknode
334                    </td>
335                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
336                        mknod name { b | c } <i>Major</i> <i>Minor</i><br>Example:<br>mknod path b 0644 1 9
337                    </td>
338                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
339                        Creates an index node corresponding to a directory entry and a special file.
340                    </td>
341                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
342                        Standard system
343                    </td>
344                </tr>
345                <tr height="185" style="height:138.75pt">
346                    <td height="185" class="xl6621952" width="140" style="height:138.75pt;border-top: none;width:105pt">
347                        makedev
348                    </td>
349                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
350                        makedev <i>major</i> <i>minor</i><br>Example:<br>makedev -v update
351                    </td>
352                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
353                        Creates a static device node, which is usually in the <strong>/dev</strong> directory.
354                    </td>
355                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
356                        Standard system
357                    </td>
358                </tr>
359                <tr height="231" style="height:173.25pt">
360                    <td height="231" class="xl6621952" width="140" style="height:173.25pt;border-top: none;width:105pt">
361                        symlink
362                    </td>
363                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
364                        symlink target <i>link_name</i><br>Example<br>symlink /proc/self/fd/0 /dev/stdin
365                    </td>
366                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
367                        Creates a symbolic link.
368                    </td>
369                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
370                        Standard system
371                    </td>
372                </tr>
373                <tr height="139" style="height:104.25pt">
374                    <td height="139" class="xl6621952" width="140" style="height:104.25pt;border-top: none;width:105pt">
375                        trigger
376                    </td>
377                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
378                        trigger <i>jobName</i><br>Example<br>trigger early-fs
379                    </td>
380                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
381                        Triggers a job.
382                    </td>
383                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
384                        Standard system
385                    </td>
386                </tr>
387                <tr height="116" style="height:87.0pt">
388                    <td height="116" class="xl6621952" width="140" style="height:87.0pt;border-top: none;width:105pt">
389                        insmod
390                    </td>
391                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
392                        insmod <ko name> [-f] [options]<br>Example<br>insmod xxx.ko
393                    </td>
394                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
395                        Loads a kernel module file.
396                    </td>
397                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
398                        Standard system
399                    </td>
400                </tr>
401                <tr height="277" style="height:207.75pt">
402                    <td height="277" class="xl6621952" width="140" style="height:207.75pt;border-top: none;width:105pt">
403                        setparam
404                    </td>
405                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
406                        setparam <i>paramname</i> <i>paramvalue</i><br>Example:<br>setparam sys.usb.config hdc
407                    </td>
408                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
409                        Sets system parameters.
410                    </td>
411                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
412                        Standard system
413                    </td>
414                </tr>
415                <tr height="231" style="height:173.25pt">
416                    <td height="231" class="xl6621952" width="140" style="height:173.25pt;border-top: none;width:105pt">
417                        load_persist_params
418                    </td>
419                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
420                        load persist params<br>Example:<br>load_persist_params&nbsp;
421                    </td>
422                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
423                        Loads <strong>persist</strong> parameters. There must be one and only one space after the <strong>load_persist_params</strong> command.
424                    </td>
425                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
426                        Standard system
427                    </td>
428                </tr>
429                <tr height="208" style="height:156.0pt">
430                    <td height="208" class="xl6621952" width="140" style="height:156.0pt;border-top: none;width:105pt">
431                        load_param
432                    </td>
433                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
434                        load <i>params</i><br>Example:<br>load_param /data/test.normal.para
435                    </td>
436                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
437                        Loads the parameters from a file to the memory.
438                    </td>
439                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
440                        Standard system
441                    </td>
442                </tr>
443                <tr height="278" style="mso-height-source:userset;height:208.5pt">
444                    <td height="278" class="xl6621952" width="140" style="height:208.5pt;border-top: none;width:105pt">
445                        load_access_token_id
446                    </td>
447                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
448                        load_access_token_id&nbsp;
449                    </td>
450                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
451                        Writes the access token to the <strong>data/service/el0/access_token/nativetoken.json</strong> file. There is one and only one space after <strong>load_access_token_id</strong>.
452                    </td>
453                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
454                        Standard system
455                    </td>
456                </tr>
457                <tr height="139" style="height:104.25pt">
458                    <td height="139" class="xl6621952" width="140" style="height:104.25pt;border-top: none;width:105pt">
459                        ifup
460                    </td>
461                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
462                        ifup <i>NIC</i><br>Example:<br>ifup eth0
463                    </td>
464                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
465                        Activates the specified NIC.
466                    </td>
467                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
468                        Standard system
469                    </td>
470                </tr>
471                <tr height="208" style="height:156.0pt">
472                    <td height="208" class="xl6621952" width="140" style="height:156.0pt;border-top: none;width:105pt">
473                        mount_fstab
474                    </td>
475                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
476                        mount_fstab fstab.test<br>Example:<br>mount_fstab /vendor/etc/fstab.test
477                    </td>
478                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
479                        Mounts partitions based on the <strong>fstab</strong> file.
480                    </td>
481                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
482                        Standard system
483                    </td>
484                </tr>
485                <tr height="208" style="height:156.0pt">
486                    <td height="208" class="xl6621952" width="140" style="height:156.0pt;border-top: none;width:105pt">
487                        umount_fstab
488                    </td>
489                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
490                        umount_fstab fstab.test<br>Example:<br>umount_fstab /vendor/etc/fstab.test
491                    </td>
492                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
493                        Unmounts partitions based on the <strong>fstab</strong> file.
494                    </td>
495                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
496                        Standard system
497                    </td>
498                </tr>
499                <tr height="162" style="height:121.5pt">
500                    <td height="162" class="xl6621952" width="140" style="height:121.5pt;border-top: none;width:105pt">
501                        restorecon
502                    </td>
503                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
504                        restorecon <i>file or dir</i><br>Example:<br>restorecon /file
505                    </td>
506                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
507                        Reloads the SELinux context.
508                    </td>
509                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
510                        Standard system
511                    </td>
512                </tr>
513                <tr height="254" style="height:190.5pt">
514                    <td height="254" class="xl6621952" width="140" style="height:190.5pt;border-top: none;width:105pt">
515                        stopAllServices
516                    </td>
517                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
518                        stopAllServices [bool]<br>Example:<br>stopAllServices false<br>stopAllServices
519                    </td>
520                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
521                        Stops all services.
522                    </td>
523                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
524                        Standard system
525                    </td>
526                </tr>
527                <tr height="162" style="height:121.5pt">
528                    <td height="162" class="xl6621952" width="140" style="height:121.5pt;border-top: none;width:105pt">
529                        umount
530                    </td>
531                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
532                        umount <i>path</i><br>Example:<br>umount /vendor
533                    </td>
534                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
535                        Unmounts a mounted device.
536                    </td>
537                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
538                        Standard system
539                    </td>
540                </tr>
541                <tr height="185" style="height:138.75pt">
542                    <td height="185" class="xl6621952" width="140" style="height:138.75pt;border-top: none;width:105pt">
543                        sync
544                    </td>
545                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
546                        sync&nbsp;
547                    </td>
548                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
549                        Writes data to the disk synchronously. There is only one and only one space after <strong>sync</strong>.
550                    </td>
551                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
552                        Standard system
553                    </td>
554                </tr>
555                <tr height="185" style="height:138.75pt">
556                    <td height="185" class="xl6621952" width="140" style="height:138.75pt;border-top: none;width:105pt">
557                        timer_start
558                    </td>
559                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
560                        timer_start <i>serviceName</i><br>Example:<br>timer_start console
561                    </td>
562                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
563                        Starts the service timer.
564                    </td>
565                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
566                        Standard system
567                    </td>
568                </tr>
569                <tr height="185" style="height:138.75pt">
570                    <td height="185" class="xl6621952" width="140" style="height:138.75pt;border-top: none;width:105pt">
571                        timer_stop
572                    </td>
573                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
574                        timer_stop <i>serviceName</i><br>Example:<br>timer_stop console
575                    </td>
576                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
577                        Stops the service timer.
578                    </td>
579                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
580                        Standard system
581                    </td>
582                </tr>
583                <tr height="162" style="height:121.5pt">
584                    <td height="162" class="xl6621952" width="140" style="height:121.5pt;border-top: none;width:105pt">
585                        init_global_key
586                    </td>
587                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
588                        init_global_key <i>path</i><br>Example:<br>init_global_key /data
589                    </td>
590                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
591                        Initializes the encryption key of the data partition file.
592                    </td>
593                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
594                        Standard system
595                    </td>
596                </tr>
597                <tr height="70" style="height:52.5pt">
598                    <td height="70" class="xl6621952" width="140" style="height:52.5pt;border-top:none; width:105pt">
599                        init_main_user
600                    </td>
601                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
602                        init_main_user
603                    </td>
604                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
605                        Encrypts the main user directory.
606                    </td>
607                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
608                        Standard system
609                    </td>
610                </tr>
611                <tr height="162" style="height:121.5pt">
612                    <td height="162" class="xl6621952" width="140" style="height:121.5pt;border-top: none;width:105pt">
613                        mkswap
614                    </td>
615                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
616                        mkswap <i>file</i><br>Example:<br>mkswap /swapfile1
617                    </td>
618                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
619                        Creates a swap partition on a file or device.
620                    </td>
621                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
622                        Standard system
623                    </td>
624                </tr>
625                <tr height="162" style="height:121.5pt">
626                    <td height="162" class="xl6621952" width="140" style="height:121.5pt;border-top: none;width:105pt">
627                        swapon
628                    </td>
629                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
630                        swapon <i>file</i><br>Example:<br>swapon /swapfile1
631                    </td>
632                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
633                        Activates the swap space.
634                    </td>
635                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
636                        Standard system
637                    </td>
638                </tr>
639                <tr height="162" style="height:121.5pt">
640                    <td height="162" class="xl6621952" width="140" style="height:121.5pt;border-top: none;width:105pt">
641                        mksandbox
642                    </td>
643                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
644                        mksandbox <i>fileName</i><br>Example:<br>mksandbox system
645                    </td>
646                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
647                        Creates a sandbox.
648                    </td>
649                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
650                        Standard system
651                    </td>
652                </tr>
653                <tr height="384" style="mso-height-source:userset;height:288.0pt">
654                    <td height="384" class="xl6621952" width="140" style="height:288.0pt;border-top: none;width:105pt">
655                        loadcfg
656                    </td>
657                    <td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
658                        loadcfg <i>filePath</i><br>Example:<br>loadcfg /patch/fstab.cfg
659                    </td>
660                    <td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
661                        Loads other <strong>.cfg</strong> files. The maximum size of the target file (only <strong>/patch/fstab.cfg</strong> supported currently) is 50 KB. Each line in the <strong>/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.
662                    </td>
663                    <td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
664                        Small system
665                    </td>
666                </tr><!--[endif]-->
667            </tbody>
668    </table>
669
670### Available APIs
671Job management is a part of the init startup process. It is a process-based function that completely serves the init startup process. It does not provide any functional APIs for other modules. It works in a way similar to command group management and does not provide help for other types of management. The following describes the job management APIs.
672
673**Table 2** Description of job parsing APIs
674<table border="0" cellpadding="0" cellspacing="0" width="968" style="border-collapse: collapse;table-layout:fixed;width:727pt;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px; text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial; box-sizing: border-box;border-spacing: 0px;word-break:initial;font-variant-ligatures: normal; font-variant-caps: normal">
675            <tbody>
676                <tr height="39" style="height:29.25pt;box-sizing: border-box">
677                    <th height="39" class="xl6320252" width="249" style="height:29.25pt;width:187pt">
678                        API
679                    </th>
680                    <th class="xl6420252" width="235" style="width:176pt;border-image: initial">
681                        Input Parameter
682                    </th>
683                    <th class="xl6420252" width="106" style="width:80pt;border-image: initial">
684                        Return Value
685                    </th>
686                    <th class="xl6420252" width="200" style="width:150pt;border-image: initial">
687                        Description
688                    </th>
689                    <th class="xl6520252" width="170" style="width:134pt;border-image: initial">
690                        Supported System Type
691                    </th>
692                </tr>
693                <tr height="99" style="mso-height-source:userset;height:74.25pt;box-sizing: border-box">
694                    <td height="99" class="xl6620252" width="249" style="height:74.25pt;width:187pt; border-image: initial;box-sizing: border-box">
695                        void ParseAllJobs(const cJSON *fileRoot)
696                    </td>
697                    <td class="xl6720252" width="235" style="width:176pt;border-image: initial; box-sizing: border-box">
698                        const cJSON *fileRoot
699                    </td>
700                    <td class="xl6720252" width="106" style="width:80pt;border-image: initial; box-sizing: border-box">
701                        void
702                    </td>
703                    <td class="xl6720252" width="200" style="width:150pt;border-image: initial; box-sizing: border-box">
704                        Provides the general entry for parsing jobs.
705                    </td>
706                    <td class="xl6720252" width="170" style="width:134pt;border-image: initial; box-sizing: border-box">
707                        Small and standard systems
708                    </td>
709                </tr>
710                <tr height="147" style="mso-height-source:userset;height:110.25pt;box-sizing: border-box">
711                    <td height="147" class="xl6820252" width="249" style="height:110.25pt;width:187pt; border-image: initial;box-sizing: border-box">
712                        static void ParseJob(const cJSON <span style="mso-spacerun:yes">&nbsp;</span>*jobItem, Job *resJob)
713                    </td>
714                    <td class="xl6920252" width="235" style="width:176pt;border-image: initial; box-sizing: border-box">
715                        const cJSON *jobItem, Job *resJob
716                    </td>
717                    <td class="xl6920252" width="106" style="width:80pt;border-image: initial; box-sizing: border-box">
718                        void
719                    </td>
720                    <td class="xl7020252" width="200" style="width:150pt;border-image: initial; box-sizing: border-box">
721                        Checks whether a job exists and parses <strong>cmds</strong> in it.
722                    </td>
723                    <td class="xl6920252" width="170" style="width:134pt;border-image: initial; box-sizing: border-box">
724                        Small system
725                    </td>
726                </tr>
727                <tr height="177" style="mso-height-source:userset;height:132.75pt;box-sizing: border-box">
728                    <td height="177" class="xl6620252" width="249" style="height:132.75pt;width:187pt; border-image: initial;box-sizing: border-box">
729                        int GetCmdLinesFromJson(const cJSON *root, CmdLines **cmdLines)
730                    </td>
731                    <td class="xl6720252" width="235" style="width:176pt;border-image: initial; box-sizing: border-box">
732                        const cJSON *root, CmdLines **cmdLines
733                    </td>
734                    <td class="xl6720252" width="106" style="width:80pt;border-image: initial; box-sizing: border-box">
735                        int
736                    </td>
737                    <td class="xl6720252" width="200" style="width:150pt">
738                        Parses <strong>cmds</strong> in the job. This API is used for the small system. It does not apply to the standard system because the <strong>trigger</strong> command and <strong>condition</strong> attribute are involved.
739                    </td>
740                    <td class="xl6720252" width="170" style="width:134pt;border-image: initial; box-sizing: border-box">
741                        Small and standard systems
742                    </td>
743                </tr>
744                <tr height="171" style="mso-height-source:userset;height:128.25pt;box-sizing: border-box">
745                    <td height="171" class="xl6820252" width="249" style="height:128.25pt;width:187pt; border-image: initial;box-sizing: border-box">
746                        int ParseTriggerConfig(const cJSON *fileRoot, int (*checkJobValid)(const char *jobName))
747                    </td>
748                    <td class="xl6920252" width="235" style="width:176pt;border-image: initial; box-sizing: border-box">
749                        const cJSON *fileRoot, int (*checkJobValid)(const char *jobName)
750                    </td>
751                    <td class="xl6920252" width="106" style="width:80pt;border-image: initial; box-sizing: border-box">
752                        int
753                    </td>
754                    <td class="xl6920252" width="200" style="width:150pt;border-image: initial; box-sizing: border-box">
755                        Parses the <strong>trigger</strong> command in the job.
756                    </td>
757                    <td class="xl6920252" width="170" style="width:134pt;border-image: initial; box-sizing: border-box">
758                        Standard system
759                    </td>
760                </tr>
761                <tr height="210" style="mso-height-source:userset;height:157.5pt;box-sizing: border-box">
762                    <td height="210" class="xl6620252" width="249" style="height:157.5pt;width:187pt; border-image: initial;box-sizing: border-box">
763                        static int ParseTrigger_(const TriggerWorkSpace *workSpace, const cJSON *triggerItem, int (*checkJobValid)(const char *jobName))
764                    </td>
765                    <td class="xl6720252" width="235" style="width:176pt;border-image: initial; box-sizing: border-box">
766                        const TriggerWorkSpace *workSpace, const cJSON *triggerItem, int (*checkJobValid)(const char *jobName)
767                    </td>
768                    <td class="xl6720252" width="106" style="width:80pt;border-image: initial; box-sizing: border-box">
769                        int
770                    </td>
771                    <td class="xl6720252" width="200" style="width:150pt">
772                        Obtains the job name, condition attribute, and <strong>cmds</strong> command group. Jobs are stored in a hash table, and commands are stored in a queue structure.
773                    </td>
774                    <td class="xl6720252" width="170" style="width:134pt;border-image: initial; box-sizing: border-box">
775                        Standard system
776                    </td>
777                </tr><!--[endif]-->
778            </tbody>
779    </table>
780
781**Table 3** Description of the job triggering APIs
782<table border="0" cellpadding="0" cellspacing="0" width="906" style="border-collapse: collapse;table-layout:fixed;width:681pt;box-sizing: border-box;border-spacing: 0px; word-break:initial;font-variant-ligatures: normal;font-variant-caps: normal; orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial; text-decoration-style: initial;text-decoration-color: initial">
783            <tbody>
784                <tr height="39" style="height:35.25pt;box-sizing: border-box">
785                    <th height="47" class="xl6322245" width="239" style="height:35.25pt;width:153pt">
786                        API
787                    </th>
788                    <th class="xl6322245" width="235" style="border-left:none;width:178pt">
789                        Input Parameter
790                    </th>
791                    <th class="xl6322245" width="106" style="border-left:none;width:80pt">
792                        Return Value
793                    </th>
794                    <th class="xl6322245" width="200" style="border-left:none;width:128pt">
795                        Description
796                    </th>
797                    <th class="xl6322245" width="170" style="border-left:none;width:133pt">
798                        Supported System Type
799                    </th>
800                </tr>
801                <tr height="257" style="mso-height-source:userset;height:192.75pt;box-sizing: border-box">
802                    <td height="257" class="xl6422245" width="204" style="height:192.75pt;border-top: none;width:153pt;box-sizing: border-box">
803                        void PostTrigger(EventType type, const char *content, uint32_t contentLen)
804                    </td>
805                    <td class="xl6422245" width="235" style="border-top:none;border-left:none; width:178pt;box-sizing: border-box">
806                        EventType type, const char *content, uint32_t contentLen
807                    </td>
808                    <td class="xl6422245" width="106" style="border-top:none;border-left:none; width:80pt;box-sizing: border-box">
809                        void
810                    </td>
811                    <td class="xl6422245" width="170" style="border-top:none;border-left:none; width:128pt;box-sizing: border-box">
812                        Verifies the validity of the job name and sends a job triggering event.
813                    </td>
814                    <td class="xl6422245" width="170" style="border-top:none;border-left:none; width:133pt;box-sizing: border-box">
815                        Standard system
816                    </td>
817                </tr>
818                <tr height="323" style="height:242.25pt;box-sizing: border-box">
819                    <td height="323" class="xl6522245" width="204" style="height:242.25pt;border-top: none;width:153pt;box-sizing: border-box">
820                        static void SendTriggerEvent(int type, const char *content, uint32_t contentLen)
821                    </td>
822                    <td class="xl6522245" width="235" style="border-top:none;border-left:none; width:178pt;box-sizing: border-box">
823                        int type, const char *content, uint32_t contentLen
824                    </td>
825                    <td class="xl6522245" width="106" style="border-top:none;border-left:none; width:80pt;box-sizing: border-box">
826                        void
827                    </td>
828                    <td class="xl6522245" width="170" style="border-top:none;border-left:none; width:128pt;box-sizing: border-box">
829                        Performs functions such as system control and starting or stopping of services based on system parameters.
830                    </td>
831                    <td class="xl6522245" width="170" style="border-top:none;border-left:none; width:133pt;box-sizing: border-box">
832                        Standard system
833                    </td>
834                </tr>
835                <tr height="188" style="mso-height-source:userset;height:141.0pt;box-sizing: border-box">
836                    <td height="188" class="xl6422245" width="204" style="height:141.0pt;border-top: none;width:153pt;box-sizing: border-box">
837                        static void DoTriggerCmd(const struct CmdArgs *ctx)
838                    </td>
839                    <td class="xl6422245" width="235" style="border-top:none;border-left:none; width:178pt;box-sizing: border-box">
840                        const struct CmdArgs *ctx
841                    </td>
842                    <td class="xl6422245" width="106" style="border-top:none;border-left:none; width:80pt;box-sizing: border-box">
843                        void
844                    </td>
845                    <td class="xl6422245" width="170" style="border-top:none;border-left:none; width:128pt;box-sizing: border-box">
846                        Executes the <strong>trigger</strong> command.
847                    </td>
848                    <td class="xl6422245" width="170" style="border-top:none;border-left:none; width:133pt;box-sizing: border-box">
849                        Standard system
850                    </td>
851                </tr>
852                <tr height="258" style="mso-height-source:userset;height:193.5pt;box-sizing: border-box">
853                    <td height="258" class="xl6522245" width="204" style="height:193.5pt;border-top: none;width:153pt;box-sizing: border-box">
854                        void DoTriggerExec(const char *triggerName)
855                    </td>
856                    <td class="xl6522245" width="235" style="border-top:none;border-left:none; width:178pt;box-sizing: border-box">
857                        const char *triggerName
858                    </td>
859                    <td class="xl6522245" width="106" style="border-top:none;border-left:none; width:80pt;box-sizing: border-box">
860                        void
861                    </td>
862                    <td class="xl6522245" width="170" style="border-top:none;border-left:none; width:128pt;box-sizing: border-box">
863                        Finds a command group based on the job name and pushes the commands in the command group to the execution queue. This API is available only for the standard system.
864                    </td>
865                    <td class="xl6522245" width="170" style="border-top:none;border-left:none; width:133pt;box-sizing: border-box">
866                        Standard system
867                    </td>
868                </tr>
869                <tr height="254" style="height:190.5pt;box-sizing: border-box">
870                    <td height="254" class="xl6422245" width="204" style="height:190.5pt;border-top: none;width:153pt;box-sizing: border-box">
871                        void DoJob(const char *jobName)
872                    </td>
873                    <td class="xl6422245" width="235" style="border-top:none;border-left:none; width:178pt;box-sizing: border-box">
874                        const char *jobName
875                    </td>
876                    <td class="xl6422245" width="118" style="border-top:none;border-left:none; width:80pt;box-sizing: border-box">
877                        void
878                    </td>
879                    <td class="xl6422245" width="170" style="border-top:none;border-left:none; width:128pt;box-sizing: border-box">
880                        Matches a job based on the job name and invokes <strong>DoCmdByIndex</strong> to execute the commands in the job.
881                    </td>
882                    <td class="xl6422245" width="170" style="border-top:none;border-left:none; width:133pt;box-sizing: border-box">
883                        Small system
884                    </td>
885                </tr>
886                <tr height="208" style="height:156.0pt;box-sizing: border-box">
887                    <td height="208" class="xl6522245" width="204" style="height:156.0pt;border-top: none;width:153pt;box-sizing: border-box">
888                        void DoCmdByIndex(int index, const char *cmdContent)
889                    </td>
890                    <td class="xl6522245" width="235" style="border-top:none;border-left:none; width:178pt;box-sizing: border-box">
891                        int index, const char *cmdContent
892                    </td>
893                    <td class="xl6522245" width="118" style="border-top:none;border-left:none; width:80pt;box-sizing: border-box">
894                        void
895                    </td>
896                    <td class="xl6522245" width="170" style="border-top:none;border-left:none; width:128pt;box-sizing: border-box">
897                        Combines parameters and commands.
898                    </td>
899                    <td class="xl6522245" width="170" style="border-top:none;border-left:none; width:133pt;box-sizing: border-box">
900                        Small and standard systems
901                    </td>
902                </tr><!--[endif]-->
903            </tbody>
904    </table>
905
906### Development Example
907The following is the template for configuring <strong>jobs</strong> in the <strong>.cfg</strong> file. You can use it to verify the job management function.
908```
909{
910    "jobs" : [{     // Basic job
911            "name" : "stage1",
912            "cmds" : [
913                "start service1",
914                "mkdir dir1"
915            ]
916        }, {        // Conditional job
917            "name" : "param:test.name1=0",
918            "condition" : "test.name1=0",
919            "cmds" : [
920                "chmod 0755 dir1",
921                "chown root root dir1"
922            ]
923        }, {        // Custom job
924            "name" : "param:test.name2=*",
925            "condition" : "test.name2=*",
926            "cmds" : [
927                "chmod 0644 dir1",
928                "chown system system dir1"
929            ]
930        }
931    ]
932}
933```
934The differences in job configuration are described as follows:
935
9361. <strong>name</strong> and <strong>cmds</strong> are mandatory for a job, and <strong>cmds</strong> must contain commands supported by the system.
937
9382. <strong>condition</strong> is an optional attribute of a job. It indicates that the job is triggered only when the specified condition is met; that is, the job will not be invoked in a specific phase by the code or the <strong>trigger</strong> command.
939
9403. The job name must comply with the specified rules. For a job whose condition is a system parameter, its name is prefixed with <strong>param:</strong>.
941
9424. Commands in a renamed job can be executed only after being triggered by the <strong>trigger</strong> command in other executable job command groups. By default, the <strong>trigger</strong> command is executed in the post-init phase.
943
9445. An existing job name can be used in different files. Jobs with the same name are regarded as the same job. When jobs with the same name are executed, the commands in these jobs are executed together.
945
9466. For a conditional job, a condition is usually a system parameter. You can set a specific value so that the job is triggered when the condition is met. You can also set the value to an asterisk (*) so that the job is triggered whenever the condition is met, regardless of the parameter value.
947
9487. For the small system, the commands in a job cannot be triggered by the <strong>trigger</strong> command in the post-init phase.
949