]> git.proxmox.com Git - pve-installer.git/commit
sys: command: allow terminating the process early from log subroutine
authorChristoph Heiss <c.heiss@proxmox.com>
Tue, 13 Feb 2024 15:14:01 +0000 (16:14 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 23 Feb 2024 13:19:56 +0000 (14:19 +0100)
commit23c5fbe67a4b9054e429fe8449e662e7f1feff4c
tree23cf2d1002236421b31c76bbb144926202c9f4ba
parent7a95f3873fc9422c5266b8fc3dfa7ef85abee2e3
sys: command: allow terminating the process early from log subroutine

If the logging subroutine $func returns CMD_FINISHED after processing a
line, the running subprocess is killed early.
This mechanism can be used when e.g. only a certain part of the output
of a (long-running) command is needed, avoiding the extra time it would
take the command to finish properly.

This is done in a entirely backwards-compatible way, i.e. existing
usages don't need any modification.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Proxmox/Sys/Command.pm