exit_hook isn't called after request_failure #508

Closed
opened 2025-12-29 01:26:28 +01:00 by adam · 4 comments
Owner

Originally created by @glance- on GitHub (Nov 27, 2020).

After request_failure is called, dehydrated just does exit 1, and not _exiterr which calls exit_hook.

I expected every run to have equal amounts of startup_hook and exit_hook calls.

Originally created by @glance- on GitHub (Nov 27, 2020). After request_failure is called, dehydrated just does exit 1, and not _exiterr which calls exit_hook. I expected every run to have equal amounts of startup_hook and exit_hook calls.
adam closed this issue 2025-12-29 01:26:28 +01:00
Author
Owner

@j-ed commented on GitHub (Nov 27, 2020):

Con you please provide more detailed information about the used script version, your configuration, the messages shown if you run into such an error. I might be wrong, but for me it looks like the _exiterr function is called if the request_failure hook returned with a non-zero exit code and the exit hook is being called right after an error message has been displayed on the screen?!

@j-ed commented on GitHub (Nov 27, 2020): Con you please provide more detailed information about the used script version, your configuration, the messages shown if you run into such an error. I might be wrong, but for me it looks like the `_exiterr` function is called if the request_failure hook returned with a non-zero exit code and the exit hook is being called right after an error message has been displayed on the screen?!
Author
Owner

@glance- commented on GitHub (Nov 30, 2020):

I'm using current master, and that code haven't changed in quite a while.

I'm using hooks to integrate dehydrated with the rest of our system, and one of those tasks is that we remount the dehydrated config directory rw in the startup_hook and remount it ro in the exit_hook.

Yes, _exiterr is called if request_failure hook fails, but if request_failure hook just returns zero or isn't implemented, exit_hook is never called, dehydrated just does a exit 1. This is the only exit point from dehydrated where exit_hook isn't called.

@glance- commented on GitHub (Nov 30, 2020): I'm using current master, and that code haven't changed in quite a while. I'm using hooks to integrate dehydrated with the rest of our system, and one of those tasks is that we remount the dehydrated config directory rw in the startup_hook and remount it ro in the exit_hook. Yes, _exiterr is called if request_failure hook fails, but if request_failure hook just returns zero or isn't implemented, exit_hook is never called, dehydrated just does a exit 1. This is the only exit point from dehydrated where exit_hook isn't called.
Author
Owner

@lukas2511 commented on GitHub (Dec 10, 2020):

Should be fixed now.

@lukas2511 commented on GitHub (Dec 10, 2020): Should be fixed now.
Author
Owner

@glance- commented on GitHub (Dec 10, 2020):

Nice, Thanks.

@glance- commented on GitHub (Dec 10, 2020): Nice, Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#508