Skip to content
  • Andrey Vagin's avatar
    eb9a6f20
    restore: add interface for creating helper tasks (v3) · eb9a6f20
    Andrey Vagin authored
    
    
    They will be used for restoring sid. For example, if a session
    group leader is absent, a helper process is created with this id
    and it will die after restoring all other tasks.
    
    Before this patch restore failed if anyone exited.
    Now we should skip helpers, which exited successfully. It's a bit tricky.
    All children are collected in sigchld_handler, but we have a point,
    where we want to wait all helpers. For that waitpit is used and ECHLD
    is ignored, because it signs that a helper exited and has been waited in
    sigchld_handler.
    
    v2: check that me isn't NULL in the sig handler
    v3: move code about waiting helpers in a separate function
    
    Signed-off-by: default avatarAndrey Vagin <avagin@openvz.org>
    Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
    eb9a6f20
    restore: add interface for creating helper tasks (v3)
    Andrey Vagin authored
    
    
    They will be used for restoring sid. For example, if a session
    group leader is absent, a helper process is created with this id
    and it will die after restoring all other tasks.
    
    Before this patch restore failed if anyone exited.
    Now we should skip helpers, which exited successfully. It's a bit tricky.
    All children are collected in sigchld_handler, but we have a point,
    where we want to wait all helpers. For that waitpit is used and ECHLD
    is ignored, because it signs that a helper exited and has been waited in
    sigchld_handler.
    
    v2: check that me isn't NULL in the sig handler
    v3: move code about waiting helpers in a separate function
    
    Signed-off-by: default avatarAndrey Vagin <avagin@openvz.org>
    Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
Loading