exec()
Spawn a process
Synopsis:
exec()
Description:
The exec function spawns a process using the parameters defined in the task.
Multiplicity:
No instance or one instance in a task block.
Constraints:
-
Only one exec() is allowed in a task.
-
If a task has an exec() function, then that task must define the command property.
-
The parser will reject a configuration file if a task has an exec() without a command definition.
-
The user will use an exec() to spawn long-running processes.
-
If exec() is used in the main task, then PLMS will monitor the process for abnormal termination and respond with recovery actions.
-
If a component is configured for watchdog monitoring, the process started by exec() in the main task can provide the watchdog heartbeat to PLMS.
-
If exec() is used in other user-defined tasks, the abnormal termination of the process is ignored, and no recovery actions are taken.
-
An exec() in any user-defined tasks (i.e., non-main tasks) will be interpreted as spawning the process and does not wait for the process to exit, and if the process exits it is not considered as a task failure.
-
If an exec() is used, then exec_waitfor_exit() and exec_expect_exit() are not allowed in the same task.
Restriction:
plms doesn't support monitoring of daemons created using the daemon() C library API. If you want a component to start an application that uses daemon(), then the component can use exec() to start the process in a user-defined task.
