YaST2 Developers Documentation: SCR Process agent functions | ![]() |
![]() |
SCR Process agent functions
Return list od processes (IDs) managed by the process agent. Example: Dir(.process) -> [ 23568, 28896 ]
Wrtites the input string to stdin of the process. Returns true on success. Example: Write(.process, 12345, "foo") -> true
Returns boolean whether the stdout buffer is empty, if buffer is not empty, false is returned. Example: Read (.process.buffer_empty, 12345) -> false
Close input/output of the process and wait until the process ends Returns Exit value of the process Example: Execute(.process.close, 12345) -> 0
Send a signal to the process, if signal is missing then SIGKILL is sent. Example: Execute(.process.kill, 12345, 15) -> true // send SIGTERMExample: Execute(.process.kill, 12345) -> true // send SIGKILL
Returns the PID of a process Example: Read (.process.pid, 12345) -> 6789
Returns read stdout of the process, nil if there is no output. This read function is not line-oriented, the output can contain multiple lines or just part of a line. Example: Read (.process.read, 12345) -> nil
Returns one line from stdout of the process, nil if there is no output Example: Read (.process.read_line, 12345) -> nil
Returns one line from stderr of the process, nil if there is no output Example: Read (.process.read_line_stderr, 12345) -> nil
Returns read stderr of the process, nil if there is no output. This read function is not line-oriented, the output can contain multiple lines or just part of a line. Example: Read (.process.read_stderr, 12345) -> nil
Removes the process from the internal structure and releases all allocated resources (buffers). If the process is running then it is killed by SIGKILL at first. Example: Execute(.process.release, 12345) -> true
Returns true if the process is running Example: Read (.process.running, 12345) -> true
Execute the command. The string command is a path to the program, arguments are passed in the map - value of key "args" must be list Returns ID of the started process
Example:
Execute the command in a shell (/bin/sh). The command can contain all shell features like
argument expansion, stdout/stderr redirection...
The optional map can contain additional configuration: "tty" : boolean - run the command in terminal (instead of piped stdout/stderr), the default is false,
"C_locale" : boolean - use C locale (default false), "env" : map Returns ID of the started process
Example:
Returns exit status of the process, if the process is still running nil is returned.
Example: |
YaST2 Developers Documentation: SCR Process agent functions | ![]() |