commit 9c4b3557b7820a385b4557a4e34d2ee84601b08a
parent 6af71622e11d2de08a74cc3ed81e26e72ae3fbd7
Author: Christopher Warrington <chrisw@rice.edu>
Date: Mon, 10 Nov 2008 04:26:29 -0600
added a shutdown hook
A shutdown hook has been added. It runs during sup's shutdown,
right before Redwood::finish is called.
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/bin/sup b/bin/sup
@@ -45,6 +45,14 @@ No variables.
No return value.
EOS
+Redwood::HookManager.register "shutdown", <<EOS
+Executes when sup is shutting down. May be run when sup is crashing,
+so don\'t do anything too important. Run before the label, contacts,
+and people are saved.
+No variables.
+No return value.
+EOS
+
if $opts[:list_hooks]
Redwood::HookManager.print_hooks
exit
@@ -271,6 +279,8 @@ ensure
Index.stop_lock_update_thread
end
+ HookManager.run "shutdown"
+
Redwood::finish
stop_cursing
Redwood::log "stopped cursing"