Skip to content

Instantly share code, notes, and snippets.

@malcolmsparks
Created May 6, 2018 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malcolmsparks/0b70e4027c595eb6cd0b8a44357cd09b to your computer and use it in GitHub Desktop.
Save malcolmsparks/0b70e4027c595eb6cd0b8a44357cd09b to your computer and use it in GitHub Desktop.
Reset on HUP signal
(defn reset-on-hup []
(let [bindings (get-thread-bindings)]
(sun.misc.Signal/handle
(sun.misc.Signal. "HUP")
(reify sun.misc.SignalHandler
(handle [_ signal]
(with-bindings bindings
(println (reset))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment