Giter Site home page Giter Site logo

pdeathsigexec's Introduction

SYNOPSIS

pdeathsigexec cmd ...

DESCRIPTION

pdeathsigexec: signal process when parent exits

A subprocess whose parent exits can be re-parented to init (PID 1) and continue to run. pdeathsigexec sets the process to have a signal sent if the parent process terminates.

The "signal on parent termination" behaviour applies to the executed process only and not descendents (prctl(2)):

The parent-death signal setting is cleared for the child of a fork(2).
It is also (since Linux 2.4.36 / 2.6.23) cleared when  executing  a
set-user-ID or set-group-ID binary, or a binary that has associated
capabilities (see capabilities(7)); otherwise, this value is preserved
across execve(2).

The behaviour can be set for related, dynamically linked processes in a supervision tree by using a LD_PRELOAD library (see EXAMPLES).

EXAMPLES

$ sh -c "sleep inf" &
[1] 25880
$ kill -9 25880
$ pgrep -fa sleep
25882 sleep inf

pdeathsigexec

$ sh -c "pdeathsigexec sleep inf" &
[1] 25926
$ kill -9 25926
$ pgrep -fa sleep
<no output>

libpdeathsigexec

$ LD_PRELOAD=libpdeathsigexec.so sh -c 'sh -c "sleep inf" & sleep inf' &
[1] 25987
$ kill -9 25987
$ pgrep -fa sleep
<no output>

Build

make

#### static executable using musl
./musl-make

OPTIONS

pdeathsigexec

-s/--signal : set the termination signal (default 9 (SIGKILL))

ENVIRONMENT VARIABLES

PDEATHSIGEXEC_SIGNAL : set the termination signal (default 9 (SIGKILL))

pdeathsigexec's People

Contributors

msantos avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.