From c00d2a53136d4d37a519829c4c9cad668fa69a44 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 9 Apr 2015 19:57:13 +1000 Subject: [PATCH] run dstat with run_process It is not clear to me why this can't use run_process? Currently we end up with two log-files both with the same thing - dstat.txt.gz which comes from the "tee" and is symlinked into SCREEN_LOGDIR, so gets picked-up by the gate scripts - screen-dstat.txt.gz which comes from screen_it Change-Id: I00b9e09b8d44f72ff14e69dc6e4a4bd5e2a0439e --- lib/dstat | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/lib/dstat b/lib/dstat index c8faa6578c..4b22752ced 100644 --- a/lib/dstat +++ b/lib/dstat @@ -16,34 +16,16 @@ XTRACE=$(set +o | grep xtrace) set +o xtrace - -# Defaults -# -------- -# for DSTAT logging -DSTAT_FILE=${DSTAT_FILE:-"dstat.log"} - - # start_dstat() - Start running processes, including screen function start_dstat { # A better kind of sysstat, with the top process per time slice DSTAT_OPTS="-tcmndrylpg --top-cpu-adv --top-io-adv" - if [[ -n ${LOGDIR} ]]; then - screen_it dstat "cd $TOP_DIR; dstat $DSTAT_OPTS | tee $LOGDIR/$DSTAT_FILE" - if [[ -n ${SCREEN_LOGDIR} && ${SCREEN_LOGDIR} != ${LOGDIR} ]]; then - # Drop the backward-compat symlink - ln -sf $LOGDIR/$DSTAT_FILE ${SCREEN_LOGDIR}/$DSTAT_FILE - fi - else - screen_it dstat "dstat $DSTAT_OPTS" - fi + run_process dstat "dstat $DSTAT_OPTS" } # stop_dstat() stop dstat process function stop_dstat { - # dstat runs as a console, not as a service, and isn't trackable - # via the normal mechanisms for DevStack. So lets just do a - # killall and move on. - killall dstat || /bin/true + stop_process dstat } # Restore xtrace