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

Add Post Processing Commands #129

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

JPEWdev
Copy link

@JPEWdev JPEWdev commented Dec 5, 2018

Adds support to tini for implementing post processing commands. These commands can be used to run clean up procedures, or remap exit codes.

@JPEWdev JPEWdev force-pushed the post-command branch 2 times, most recently from e7e33ab to 6480733 Compare December 5, 2018 20:20
Post processing commands can be specified on the command line. These
commands are executed after the main command exits and can optionally be
passed the exit code from the last process that tini ran.  The exit code
of the post processing command is the new exit code of tini. Multiple
post processing commands can be chained together, with the output of
each one getting the exit code of the previous one. Post processing
commands inherit the signal mask of the parent tini process (unlike the
primary child).
Tests post processing commands and chaining of post-processing commands
@JPEWdev
Copy link
Author

JPEWdev commented Jan 15, 2019

Any update on this?

@JPEWdev
Copy link
Author

JPEWdev commented Feb 6, 2019

Ping?

@krallin
Copy link
Owner

krallin commented Feb 6, 2019

I'm sorry, I haven't had much free time over the past couple of months to look after personal projects 😢 . I'll take a look as soon as I can, but I can't promise when I might be able to do so.

I know this situation can be frustrating; I apologize for that!

@JPEWdev
Copy link
Author

JPEWdev commented Feb 6, 2019

That's alright. Thank you for your time :)

@leseb
Copy link

leseb commented Feb 26, 2019

@JPEWdev, thank you, I think this is extremely valuable, my usecase would be to prevent the container from existing, so my cleanup procedure will look like sleep infinity so I can inspect the container.

@krallin perhaps you could grant merge permission to someone that you think is worthy?
Thanks.

@tianon
Copy link
Contributor

tianon commented Feb 27, 2019

Honestly, I'm a little confused by this PR -- it seems like this is pushing tini from the simple one-use-case tool it's been really great as into a more full-featured init tool like runit, supervisor, s6, etc. Wouldn't one of those tools likely be a better fit for folks who need more advanced behavior than just zombie reaping?

@JPEWdev
Copy link
Author

JPEWdev commented Feb 27, 2019

Sure, it is perfectly acceptable to close this PR as inappropriate and I'll just keep maintaining my fork that does this behaviour since I need it. I figured since I put in the effort, I would at least see if upstream was interested :)

FWIW, I did look at the other init managers and they didn't do what I needed. The important behaviour in this PR is that the post command inherits tini's signal mask, and therefore is uninterruptable by default (it can of course change that if it wants).

I attempted to make this generic enough that it could theoretically be used to replace other functionality in tini. For example, the post-processing commands can easily replace exit code remapping.

@tianon
Copy link
Contributor

tianon commented Feb 27, 2019 via email

@leseb
Copy link

leseb commented Jun 3, 2019

@krallin is there any chance that we could get some feedback on this PR? Thanks :)

@guits
Copy link

guits commented Sep 20, 2019

@krallin still no news? could be nice to see this merged at some point.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants