From 4d5bc7291ed8c6df4eb34e7b3e7ebd5bf164e718 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 29 Aug 2019 00:31:36 +0200 Subject: Pre-intialize data folder --- start-munin.sh | 12 +++++++++--- 1 file 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 -- cgit v1.2.3