Merge pull request #2132 from coreos-inc/gcore

Dump core when killing buildmanager from monit
This commit is contained in:
Brad Ison 2016-11-17 10:41:09 -08:00 committed by GitHub
commit e3dc60f6eb
3 changed files with 10 additions and 1 deletions

View file

@ -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

6
conf/kill-buildmanager.sh Executable file
View file

@ -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

View file

@ -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