summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2018-02-19 20:28:31 +0000
committerMarkos Chandras <mchandras@suse.de>2018-02-20 07:18:48 +0000
commit9be88ec945936975e93a5397d3b29421fd6b6c97 (patch)
treecbe4b5499a400cb25b609dff5c2d4dbc2c3bcdbf
parent4fc1a145810a25f6b537368ab014f7e0684dea73 (diff)
xci: scripts: vm: start-new-vm.sh: Re-arrange debug messages
This also improves (again!) the check for parallel packages managers to print some useful messages for debugging. Change-Id: I7756db80aa3ed42cd3ef37293f7116b5a9c150c1 Signed-off-by: Markos Chandras <mchandras@suse.de>
-rwxr-xr-xxci/scripts/vm/start-new-vm.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/xci/scripts/vm/start-new-vm.sh b/xci/scripts/vm/start-new-vm.sh
index 70dc4efb..6a877143 100755
--- a/xci/scripts/vm/start-new-vm.sh
+++ b/xci/scripts/vm/start-new-vm.sh
@@ -100,7 +100,6 @@ sudo virsh destroy ${VM_NAME} || true
sudo virsh undefine ${VM_NAME} || true
source /etc/os-release
-echo "Installing host (${ID,,}) dependencies..."
# check we can run sudo
if ! sudo -n "true"; then
echo ""
@@ -126,10 +125,18 @@ case ${ID,,} in
;;
esac
+echo "Checking for running package manager instance..."
while true; do
- pgrep -fa "${pkg_mgr_cmd%*install*}" 2>&1 && sleep 60 || break
+ _pkg_mgr_proc=$(pgrep -f "${pkg_mgr_cmd%*install*}")
+ if [[ -n ${_pkg_mgr_proc} ]]; then
+ echo "Wainting for process ${_pkg_mgr_proc} to finish..."
+ sleep 60
+ else
+ break
+ fi
done
+echo "Installing host (${ID,,}) dependencies..."
eval ${pkg_mgr_cmd} &> /dev/null
echo "Ensuring libvirt and docker services are running..."