Merge lp:~townsend/unity8-preview-lxc/fix-wait-for-lxc-start into lp:unity8-preview-lxc/stable

Proposed by Christopher Townsend
Status: Merged
Approved by: Stephen M. Webb
Approved revision: 46
Merged at revision: 48
Proposed branch: lp:~townsend/unity8-preview-lxc/fix-wait-for-lxc-start
Merge into: lp:unity8-preview-lxc/stable
Diff against target: 12 lines (+2/-1)
1 file modified
bin/unity8-lxc-compositor (+2/-1)
To merge this branch: bzr merge lp:~townsend/unity8-preview-lxc/fix-wait-for-lxc-start
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
Review via email: mp+251110@code.launchpad.net

Commit message

Add an lxc-wait after lxc-start to make sure the container is actually running before proceeding to the lxc-attach. Also, have to add an additional half second sleep to account for an lxc race where lxc-wait reports the container is running when in reality, it may not be.

To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) :
review: Approve
47. By Christopher Townsend

Add a half second sleep after calling lxc-wait to avoid a race when lxc-wait sees the RUNNING state, but in reality, the container is not quite up and running.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/unity8-lxc-compositor'
2--- bin/unity8-lxc-compositor 2014-12-09 20:19:50 +0000
3+++ bin/unity8-lxc-compositor 2015-03-05 14:42:28 +0000
4@@ -35,7 +35,8 @@
5
6 trap kill_unity_system_compositor TERM EXIT
7
8-lxc-wait -t 0 -s RUNNING -n $CONTAINER_NAME || lxc-start -n $CONTAINER_NAME -d
9+lxc-wait -t 0 -s RUNNING -n $CONTAINER_NAME || lxc-start -n $CONTAINER_NAME -d && \
10+ lxc-wait -t 5 -s RUNNING -n $CONTAINER_NAME && sleep 0.5
11
12 lxc-attach -n $CONTAINER_NAME -- /usr/sbin/unity-system-compositor.sleep $* &
13

Subscribers

People subscribed via source and target branches

to all changes: