summaryrefslogtreecommitdiffstats
path: root/start-munin.sh
diff options
context:
space:
mode:
Diffstat (limited to 'start-munin.sh')
-rwxr-xr-xstart-munin.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/start-munin.sh b/start-munin.sh
index 564eada..63f5732 100755
--- a/start-munin.sh
+++ b/start-munin.sh
@@ -140,9 +140,15 @@ echo "Using the following munin nodes:"
echo $NODES
echo "(ssh) $SSH_NODES"
echo "(snmp) $SNMP_NODES"
+
+# Pregenerate data
+echo "First run"
+munin-cron
+
+echo "Start data servers"
# start spawn-cgi to enable CGI interface with munin (dynamix graph generation)
-spawn-fcgi -p 9000 /usr/lib/munin/cgi/munin-cgi-graph
-spawn-fcgi -p 9001 /usr/lib/munin/cgi/munin-cgi-html
+spawn-fcgi -n -p 9000 /usr/lib/munin/cgi/munin-cgi-graph & graph_pid=$!
+spawn-fcgi -n -p 9001 /usr/lib/munin/cgi/munin-cgi-html & html_pid=$1
# start nginx
/usr/sbin/nginx
# show logs
@@ -152,7 +158,7 @@ echo "tail -F running in $pid"
sleep 1
-trap "echo 'stopping processes' ; kill $pid $cron_pid $(cat /tmp/nginx.pid) $(cat /tmp/rsyslogd.pid)" SIGTERM SIGINT
+trap "echo 'stopping processes' ; kill $pid $cron_pid $graph_pid $html_pid $(cat /tmp/nginx.pid) $(cat /tmp/rsyslogd.pid)" SIGTERM SIGINT
echo "Waiting for signal SIGINT/SIGTERM"
wait