| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If our read() of the process stdout pipe fails with EINTR (eg, if we
receive a SIGCHLD because the process exited), then
process_read_stdout_once will return a non-zero exit code, and we'll
abort any further stdout collection.
Instead, we should check for EINTR, and allow the reads to continue.
This change normalises the return value from process_read_stdout_once to
return positive on success, negative on failure, and zero on competion.
We use a positive return value for the non-error EINTR case.
Also, add a pb_log if the read fails for non-EINTR reasons.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We have a few incorrect checks for the exit status of a process; this
change adds a helper with the correct WIFEXITED && WEXITSTATUS==0 logic.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
For some process execution functions, we'd like to capture stderr as
well as stdout. Currently, we unconditionally redirect subprocess stderr
to the petitboot log file.
This change adds an add_stderr flag to struct process, which indicates
to the process library that we want stderr as well as stdout. If this is
specified, the subprocess' stderr is captured to stdout_buf.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Implement dry-run behaviour on the discover server by passing a bool to
process_init. UIs don't need to support dry runs.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
We've grown-out of pb_run_cmd a little, as we have a number of different
process types:
boot():
- kexec: short-running process, run synchronously
- boot hooks: short-running, run sync, need exit code & stdout
network init:
- interface configuration: short running, run sync
- udhcp processes are long running, we may want completion, but
doesn't block other actions
downloads:
- potentially long-running, block parse progress
config nvram:
- read: short running, can block, need stdout
- write: short running, can block
We'd like to introduce proper asynchronous processes, to allow config &
boot-option downloads without blocking the discover server.
This change introduces a new type for processes, 'struct process'. These
structures are created with process_create, and run with
process_run_sync or process_run_async. The latter reports completion
through a callback member of struct process.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|