Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lxc-attach: Fix lost return codes of spawned processes that are killed #4204

Merged
merged 1 commit into from
Oct 19, 2022

Commits on Oct 5, 2022

  1. lxc-attach: Fix lost return codes of spawned processes that are killed

    lxc-attach swallows the return codes of processes that are terminated
    via a signal, and by default exits with a return code of 0 (i.e.
    indicating success) even if the command it tried to execute was
    terminated.
    
    This patch fixes it by explicitly checking if the process was terminated
    via a signal, and returning an appropriate exit code.
    
    Note that we add 128 to the signal value to generate the exit code
    because by convention the exit code is 128 + signal number. e.g. if a
    process is killed via signal 9, then the error code is 9 + 128 = 137.
    
    Signed-off-by: Mohammed Ajmal Siddiqui <ajmalsiddiqui21@gmail.com>
    ajmalsiddiqui committed Oct 5, 2022
    Configuration menu
    Copy the full SHA
    4ebca5a View commit details
    Browse the repository at this point in the history