From 9d49ed983435cd0ff3791224dff47a4d51f0bf01 Mon Sep 17 00:00:00 2001 From: Joanna Taryma Date: Mon, 6 Feb 2017 11:30:15 -0800 Subject: [PATCH] Added printing exit code of component process if it failed to start When command failed and component failed to start, original exit code was overwritten due to original command being executed in background. This commit adds information about command's exit code to echoed message about component's start up failure. Change-Id: I8a3dd485b1b1f2d70d42c5610baac7c0c713f53a Signed-off-by: Joanna Taryma --- functions-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-common b/functions-common index 8d32bb4148..be8b07b0f7 100644 --- a/functions-common +++ b/functions-common @@ -1552,7 +1552,7 @@ function screen_process { # Append the process to the screen rc file screen_rc "$name" "$command" - screen -S $SCREEN_NAME -p $name -X stuff "$command & echo \$! >$SERVICE_DIR/$SCREEN_NAME/${name}.pid; fg || echo \"$name failed to start\" | tee \"$SERVICE_DIR/$SCREEN_NAME/${name}.failure\"$NL" + screen -S $SCREEN_NAME -p $name -X stuff "$command & echo \$! >$SERVICE_DIR/$SCREEN_NAME/${name}.pid; fg || echo \"$name failed to start. Exit code: \$?\" | tee \"$SERVICE_DIR/$SCREEN_NAME/${name}.failure\"$NL" } # Screen rc file builder