Go ahead and declare add_hook and run_hook as readonly functions
to prevent hooks from overwriting them. Too bad bash does not have
lexically scoped variables -- if it does, we could do the same with
the hook_funcs associative array.
---
functions | 49 ++++++++++++++++++++++++++-----------------------
1 files changed, 26 insertions(+), 23 deletions(-)
# Status functions
@@ -234,24 +235,26 @@ ck_status() {
# single_postkillall: after all processes have been killed in rc.single
# shutdown_poweroff: directly before powering off in rc.shutdown
#
-# Make sure to never override the add_hook and run_hook functions via functions.d
+# Declare add_hook and run_hook as read-only to prevent overwriting them.
+# Too bad we cannot do the same thing with hook_funcs