We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19f6e23 commit e6daae6Copy full SHA for e6daae6
docker/start.py
@@ -24,6 +24,7 @@
24
import os
25
import logging
26
import multiprocessing
27
+import signal
28
import shutil
29
import subprocess
30
import sys
@@ -545,12 +546,16 @@ def main():
545
546
tomcat_popen.wait()
547
548
549
+def signal_handler(signum, frame):
550
+ global tomcat_popen
551
+ print("Terminating Tomcat {}".format(tomcat_popen))
552
+ tomcat_popen.terminate()
553
+
554
+ sys.exit(1)
555
556
557
if __name__ == "__main__":
- try:
- main()
- except KeyboardInterrupt:
- global tomcat_popen
- print("Terminating Tomcat {}".format(tomcat_popen))
- tomcat_popen.terminate()
-
- sys.exit(1)
558
+ signal.signal(signal.SIGTERM, signal_handler)
559
+ signal.signal(signal.SIGINT, signal_handler)
560
561
+ main()
0 commit comments