Skip to content

Commit

Permalink
Signal handling tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
plexus committed Jun 12, 2024
1 parent a9bdc31 commit 3221f94
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lambdaisland/launchpad.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
(defonce processes (atom []))

(defn cleanup [sig]
(println "Received" (str "SIG" sig))
(println "[launchpad] Received" (str sig))
(doseq [process @processes]
(print "Killing" (.pid process))
(print "[launchpad] Killing pid" (str (.pid process) "..."))
(flush)
(.destroy process)
(println " ->" (.waitFor process))
(println (str " exit=" (.waitFor process)))
(flush))
(System/exit 0))

Expand All @@ -36,7 +36,6 @@

(set-signal-handler! "INT" cleanup)
(set-signal-handler! "TERM" cleanup)
(set-signal-handler! "KILL" cleanup)

(def cli-opts
[["-h" "--help"]
Expand Down

0 comments on commit 3221f94

Please sign in to comment.