new hooks break old installation #195

Closed
opened 2025-12-29 01:18:40 +01:00 by adam · 5 comments
Owner

Originally created by @ezbik on GitHub (Jan 30, 2017).

After upgrade to new release with new hooks, it is required to edit your hook.sh manually and insert those new empty hook functions. Without this, everything is broken:

$ ./dehydrated -c
# INFO: Using main config file /var/lib/le/config
Processing x.org with alternative names: y.org z.org
 + Checking domain name(s) of existing cert... unchanged.
 + Checking expire date of existing cert...
 + Valid till Apr 14 09:21:00 2017 GMT (Longer than 30 days). Skipping renew!
/var/lib/le/hook.sh: 130: /var/lib/le/hook.sh: exit_hook: not found
Originally created by @ezbik on GitHub (Jan 30, 2017). After upgrade to new release with new hooks, it is required to edit your `hook.sh` manually and insert those new empty hook functions. Without this, everything is broken: ``` $ ./dehydrated -c # INFO: Using main config file /var/lib/le/config Processing x.org with alternative names: y.org z.org + Checking domain name(s) of existing cert... unchanged. + Checking expire date of existing cert... + Valid till Apr 14 09:21:00 2017 GMT (Longer than 30 days). Skipping renew! /var/lib/le/hook.sh: 130: /var/lib/le/hook.sh: exit_hook: not found ```
adam closed this issue 2025-12-29 01:18:40 +01:00
Author
Owner

@ezbik commented on GitHub (Jan 30, 2017):

Is it possible to modify behavior of hook handling, so that if a hook function is not defined then ignore it?

@ezbik commented on GitHub (Jan 30, 2017): Is it possible to modify behavior of hook handling, so that if a hook function is not defined then ignore it?
Author
Owner

@lukas2511 commented on GitHub (Jan 30, 2017):

The problem is in the hook script, I'm planning on making the example hook better, ignoring unknown hooks instead of throwing errors, but for now the best fix is to just add the exit_hook from the example script to your own script.

@lukas2511 commented on GitHub (Jan 30, 2017): The problem is in the hook script, I'm planning on making the example hook better, ignoring unknown hooks instead of throwing errors, but for now the best fix is to just add the exit_hook from the example script to your own script.
Author
Owner

@lukas2511 commented on GitHub (Jan 30, 2017):

This fix of course doesn't magically fix old modified example hook scripts, you'll have to add the change yourself, but it will ensure this problem doesn't occur again in the future.

@lukas2511 commented on GitHub (Jan 30, 2017): This fix of course doesn't magically fix old modified example hook scripts, you'll have to add the change yourself, but it will ensure this problem doesn't occur again in the future.
Author
Owner

@ezbik commented on GitHub (Jan 30, 2017):

Thanks for looking into this, but your commit e545292 complicates it even more -- to sync between old and new hook.sh , a pattern list must be inserted/updated too.

Isn't it be better to let user only edit his scripts and not play with hook.sh?

E.g. by expecting user scripts in folders like ./hook/${hook_function_name}.d/, and running them via run-parts with exporting required variables?

@ezbik commented on GitHub (Jan 30, 2017): Thanks for looking into this, but your commit e545292 complicates it even more -- to sync between old and new `hook.sh` , a pattern list must be inserted/updated too. Isn't it be better to let user only edit **his** scripts and not play with `hook.sh`? E.g. by expecting user scripts in folders like `./hook/${hook_function_name}.d/`, and running them via `run-parts` with exporting required variables?
Author
Owner

@lukas2511 commented on GitHub (Jan 30, 2017):

Switching to a directory and run-parts would change everything completely, and this pattern list is just part of the example hook, other hook scripts probably never had any problems, and this way I can add new hooks without the example script failing again, I think this is a good and easy solution for this problem. If you ever want to make use of a new hook you just have to add it to the list and write a handler function, don't see any problem with that.

@lukas2511 commented on GitHub (Jan 30, 2017): Switching to a directory and run-parts would change everything completely, and this pattern list is just part of the example hook, other hook scripts probably never had any problems, and this way I can add new hooks without the example script failing again, I think this is a good and easy solution for this problem. If you ever want to make use of a new hook you just have to add it to the list and write a handler function, don't see any problem with that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#195