From: Anil Belur Date: Fri, 16 Jun 2017 02:51:33 +0000 (+1000) Subject: Add a check before running the sysstat script X-Git-Tag: v0.4.0~1^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=8ec4cbe3b24fcda4eac98be1101db78e195cd747;p=releng%2Fglobal-jjb.git Add a check before running the sysstat script Systat is not enabled by default on Ubuntu, which requires this check for projects which have not configured sysstat in their provisioning scripts. Change-Id: Idcde47ab389ff2b0bb2f5d43ee716a4a5c926fd0 Signed-off-by: Anil Belur --- diff --git a/shell/sysstat.sh b/shell/sysstat.sh index 03cab6dc..d90061c0 100644 --- a/shell/sysstat.sh +++ b/shell/sysstat.sh @@ -15,6 +15,11 @@ OS=$(facter operatingsystem) case "$OS" in Ubuntu) SYSSTAT_PATH="/var/log/sysstat" + + # Dont run the script when systat is not enabled by default + if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then + exit 0 + fi ;; CentOS|RedHat) SYSSTAT_PATH="/var/log/sa"