summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoulou <leo@unbekandt.eu>2015-12-14 00:06:54 +0100
committerSoulou <leo@unbekandt.eu>2015-12-14 00:06:59 +0100
commit6ea618fce10f44f29f997f3d9d87bc301137ca2d (patch)
treeedb40aeeb9cb5c1cedf07e27945b682703d5b274
parent91e81a2a02d25d2e0ba616d53b7cd4a128e4b553 (diff)
downloadmunin-6ea618fce10f44f29f997f3d9d87bc301137ca2d.tar.gz
munin-6ea618fce10f44f29f997f3d9d87bc301137ca2d.tar.bz2
munin-6ea618fce10f44f29f997f3d9d87bc301137ca2d.tar.xz
munin-6ea618fce10f44f29f997f3d9d87bc301137ca2d.zip
Correctly stop on SIGINT/SIGTERM signals
-rw-r--r--Dockerfile3
-rw-r--r--start-munin.sh6
2 files changed, 5 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile
index 34073bf..738b909 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -20,5 +20,4 @@ ADD ./munin-update-logging.patch /usr/share/munin
RUN cd /usr/share/munin && patch munin-graph < munin-graph-logging.patch && patch munin-update < munin-update-logging.patch
EXPOSE 8080
-CMD bash /munin
-
+CMD ["bash", "/munin"]
diff --git a/start-munin.sh b/start-munin.sh
index b2a6d78..c3aa70b 100644
--- a/start-munin.sh
+++ b/start-munin.sh
@@ -88,14 +88,16 @@ fi
/usr/sbin/munin-node
echo "Using the following munin nodes:"
echo $NODES
-# start apache
+# start nginx
/usr/sbin/nginx
# show logs
echo "Tailing /var/log/syslog..."
tail -F /var/log/syslog /var/log/munin/munin-update.log & pid=$!
+echo "tail -F running in $pid"
sleep 1
-trap "kill $pid $(cat /var/run/munin/munin-node.pid) $(cat /var/run/nginx.pid) $(cat /var/run/crond.pid) $(cat /var/run/rsyslogd.pid)" TERM QUIT INT
+trap "echo 'stopping processes' ; kill $pid $(cat /var/run/munin/munin-node.pid) $(cat /var/run/nginx.pid) $(cat /var/run/crond.pid) $(cat /var/run/rsyslogd.pid)" SIGTERM SIGINT
+echo "Waiting for signal SIGINT/SIGTERM"
wait