Browse code

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 <joanna.taryma@intel.com>

Joanna Taryma authored on 2017/02/07 04:30:15
Showing 1 changed files
... ...
@@ -1552,7 +1552,7 @@ function screen_process {
1552 1552
     # Append the process to the screen rc file
1553 1553
     screen_rc "$name" "$command"
1554 1554
 
1555
-    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"
1555
+    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"
1556 1556
 }
1557 1557
 
1558 1558
 # Screen rc file builder