Services

<< 点击显示目录 >>

主页  exOS使用助手 > exOS Automation Help > Configuration > exOS Component configuration (.exoscomponent) >

Services

ComponentServices

服务 "部分用于配置将在目标系统上执行的服务。
 

服务类型

一个 exOS 组件可能包含多个在特定场合启动的服务:

o安装程序服务:这种类型的服务在安装 exOS 组件时启动。相应的命令应运行一次并自行退出。命令的返回值不等于 0 将被视为错误。

o删除服务:每当需要移除 exOS 组件时,都会启动此类服务。相应命令将运行一次并自行退出。命令返回值不等于 0 将被视为错误。

o启动服务:此类服务在启动运行时服务之前启动。相应命令应运行一次并自行退出。命令返回值不等于 0 将被视为错误。

o运行时服务:这种类型的服务在 exOS 组件开始运行时启动。相应命令将启动一个进程,该进程将在后台持续运行,不会自行退出。如果运行时服务在 exOS 系统未请求的情况下退出,则会被视为错误。根据 错误处理设置,可能会采取进一步的措施。
 

命令行

此处指定实际命令。提供命令的方式与在 shell 上执行命令的方式相同。在调用命令前,目录会更改为工作目录设置中提供的路径。

命令行可能包含可执行文件/脚本的路径(绝对路径或与工作目录相对的路径),如果需要,还可能包含可执行文件/脚本的其他命令行参数。

注意:位于工作目录中的可执行文件必须以 ./前缀启动 。

注意:对于需要使用引号的命令行(如 echo "test"),在 exOS 组件配置中只能输入双引号。
 

工作目录

工作目录允许指定执行命令的路径。如果工作目录为空,则传输文件的位置路径将作为工作目录。


ComponentServices

The Services section configures the services that shall be executed on the target system.
 

Service type

An exOS component may contain several services that are started at specific occasions:

oInstaller Service: Services of this type are started whenever an installation of the exOS component shall be carried out. The according command shall run once and quit by itself. A return value of the command unequal to 0 is treated as an error.

oRemoval Service: Services of this type are started whenever a removal of the exOS component shall be carried out. The according command shall run once and quit by itself. A return value of the command unequal to 0 is treated as an error.

oStartup Service: Services of this type are started before starting the Runtime Services. The according command shall run once and quit by itself. A return value of the command unequal to 0 is treated as an error.

oRuntime Service: Services of this type are started when an exOS component shall become operational. The according command shall start a process that keeps running in the background and does not quit by itself. If a runtime service is quit without request by the exOS system, it is treated as an error. Depending on the error handling settings, further actions may apply.
 

Command Line

Here, the actual command is specified. A command has to be provided in the same way as if it was executed on a shell. Before calling the command, the directory is changed to the path provided in the Working directory setting.

The Command Line may contain the path to the executable/script (absolute or relative to the Working directory) and may also contain further command line arguments for the executable/script, if required.

Note: Take care that executables located in the Working directory have to be started with prefixed ./.

Note: For command lines that require the usage of quotes (e.g. echo "test"), only double-quotes can be entered in the exOS component configuration.
 

Working directory

The Working directory allows to specify a path at which the command shall be executed. If the Working directory is left empty, the path to the location of the transferred files will be taken as the Working directory.