Replace screen_it() with run_process() throughout
run_process will use screen if USE_SCREEN=True (the default),
otherwise it will simply start the requested service. Therefore
wherever screen_it used, run_process can be instead.
Where stop_screen was found it has been replaced with stop_process.
A tail_log function has been added which will tail a logfile in a
screen if USE_SCREEN is True.
lib/template has been updated to reflect the use of the new
functions.
When using sg the quoting in run_process gets very complicated.
To get around this run_process and the functions it calls accepts
an optional third argument. If set it is a group to be used with sg.
Change-Id: Ia3843818014f7c6c7526ef3aa9676bbddb8a85ca
diff --git a/lib/heat b/lib/heat
index 14094a9..a74d7b5 100644
--- a/lib/heat
+++ b/lib/heat
@@ -189,10 +189,10 @@
# start_heat() - Start running processes, including screen
function start_heat {
- screen_it h-eng "cd $HEAT_DIR; bin/heat-engine --config-file=$HEAT_CONF"
- screen_it h-api "cd $HEAT_DIR; bin/heat-api --config-file=$HEAT_CONF"
- screen_it h-api-cfn "cd $HEAT_DIR; bin/heat-api-cfn --config-file=$HEAT_CONF"
- screen_it h-api-cw "cd $HEAT_DIR; bin/heat-api-cloudwatch --config-file=$HEAT_CONF"
+ run_process h-eng "$HEAT_DIR/bin/heat-engine --config-file=$HEAT_CONF"
+ run_process h-api "$HEAT_DIR/bin/heat-api --config-file=$HEAT_CONF"
+ run_process h-api-cfn "$HEAT_DIR/bin/heat-api-cfn --config-file=$HEAT_CONF"
+ run_process h-api-cw "$HEAT_DIR/bin/heat-api-cloudwatch --config-file=$HEAT_CONF"
}
# stop_heat() - Stop running processes
@@ -200,7 +200,7 @@
# Kill the screen windows
local serv
for serv in h-eng h-api h-api-cfn h-api-cw; do
- screen_stop $serv
+ stop_process $serv
done
}