From c52f2b3e71ea02702e5137180cd9afb5e24c1f8f Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Wed, 18 Oct 2017 11:51:48 +0100 Subject: [PATCH] ADDING ENVIRONMENT VARIABLE TO CONFIGURE MONIT CYCLE INTERVAL FEATURE - README.md also updated - MONIT_DAEMON is environment variable - original default value of 60 is preserved if absent --- README.md | 1 + root/opt/monit/bin/monit-start.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6aa2a68..71ff03b 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Besides, you can customize the configuration in several ways: Monit is installed with the default configuration and some parameters can be overrided with env variables: +- MONIT_DAEMON="60" #Ā Length of monit "cycles" - MONIT_PORT="2812" # Port to listen monit httpd service - MONIT_ALLOW="localhost" # Rule to allow connections to the httpd port - MONIT_ARGS="-I" # Monit exec args diff --git a/root/opt/monit/bin/monit-start.sh b/root/opt/monit/bin/monit-start.sh index aaa27b1..44c8714 100644 --- a/root/opt/monit/bin/monit-start.sh +++ b/root/opt/monit/bin/monit-start.sh @@ -20,12 +20,13 @@ fi chmod 700 ${MONIT_HOME}/etc/monitrc +MONIT_DAEMON=${MONIT_DAEMON:-"60"} MONIT_PORT=${MONIT_PORT:-"2812"} MONIT_ALLOW=${MONIT_ALLOW:-"localhost"} MONIT_ARGS=${MONIT_ARGS:-"-I"} cat << EOF > ${MONIT_HOME}/etc/conf.d/basic -set daemon 60 +set daemon ${MONIT_DAEMON} set logfile ${MONIT_HOME}/log/monit.log set pidfile ${MONIT_HOME}/log/monit.pid set statefile ${MONIT_HOME}/log/monit.state