From ebf80bdd13e0fcf93b4705200311486a57cb293e Mon Sep 17 00:00:00 2001 From: Brad Ison Date: Wed, 16 Nov 2016 16:41:14 -0800 Subject: [PATCH] Dump core when killing buildmanager from monit --- Dockerfile | 3 +++ conf/kill-buildmanager.sh | 6 ++++++ conf/monitrc | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 conf/kill-buildmanager.sh diff --git a/Dockerfile b/Dockerfile index 94bd55d3d..6de02895f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ ENV HOME /root RUN apt-get update # 02NOV2016 RUN apt-get install -y \ g++ \ + gdb \ gdebi-core \ git \ libevent-2.0.5 \ @@ -31,6 +32,7 @@ RUN apt-get install -y \ nginx \ nodejs \ npm \ + python-dbg \ python-dev \ python-pip \ python-virtualenv @@ -113,6 +115,7 @@ ADD conf/init/zz_boot.sh /etc/my_init.d/ ADD conf/init/service/ /etc/service/ RUN rm -rf /etc/service/syslog-forwarder +ADD conf/kill-buildmanager.sh /usr/local/bin/kill-buildmanager.sh ADD conf/monitrc /etc/monit/monitrc RUN chmod 0600 /etc/monit/monitrc diff --git a/conf/kill-buildmanager.sh b/conf/kill-buildmanager.sh new file mode 100755 index 000000000..67e097e05 --- /dev/null +++ b/conf/kill-buildmanager.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +PID=$(cat /etc/service/buildmanager/supervise/pid) +gcore -o /tmp/buildman.core $PID + +/usr/bin/sv kill /etc/service/buildmanager diff --git a/conf/monitrc b/conf/monitrc index 7e3021067..87528b119 100644 --- a/conf/monitrc +++ b/conf/monitrc @@ -7,7 +7,7 @@ set httpd port 2812 and check host buildmanager with address localhost start program = "/usr/bin/sv start /etc/service/buildmanager" with timeout 10 seconds - stop program = "/usr/bin/sv kill /etc/service/buildmanager" + stop program = "/usr/local/bin/kill-buildmanager.sh" if failed port 8787 protocol http request "/" status = 405