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

safe cleanup handler #4

Closed
jackyq2015 opened this issue Oct 28, 2017 · 4 comments
Closed

safe cleanup handler #4

jackyq2015 opened this issue Oct 28, 2017 · 4 comments

Comments

@jackyq2015
Copy link

For main script clean up, it would be nice to put into a function and hook the signal to capture the unexpected exit/terminate:
https://www.ibm.com/developerworks/aix/library/au-usingtraps/index.html

@felixlohmeier
Copy link
Member

thx @jackyq2015, i will keep that in mind for the next update (sometime in November)

@felixlohmeier
Copy link
Member

hi @jackyq2015, is this what you meant? 978344a

@jackyq2015
Copy link
Author

@felixlohmeier instead of:
trap cleanup EXIT
should be something like this:
trap cleanup SIGNHUP SIGINT SIGQUIT SIGTERM

The idea is to capture all the the abnormal exit of your application for any reason(manually terminate, your script failed and OR itself failed etc). You would like an ensured clearnup to be executed no matter what.

@felixlohmeier
Copy link
Member

thx @jackyq2015, I've got it!

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

No branches or pull requests

2 participants