Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sometimes need delay before $Pid1pid is valid #133

Closed
gidfiddle opened this issue Feb 28, 2019 · 1 comment
Closed

sometimes need delay before $Pid1pid is valid #133

gidfiddle opened this issue Feb 28, 2019 · 1 comment
Labels

Comments

@gidfiddle
Copy link

gidfiddle commented Feb 28, 2019

x11docker --version: 5.4.4

On a rather slow Ubuntu 18.04 machine, the command

x11docker --nxagent ubuntu:bionic

always fails with a "Container startup seems to have failed." error, despite (usually) working well on a faster Fedora 29 machine. I traced the problem to the following statement in the x11docker script:

Pid1pid=$($Dockerexe inspect --format '{{.State.Pid}}' $Containername 2>>$Containerlogfile | rmcr)

sets Pid1pid to zero. I succeeded in working around this problem by putting this line in a loop like another one in the script:

for ((Count=1 ; Count<=20 ; Count++)); do
    [line above]
    if test x$Pid1pid != x && test $Pid1pid -ne 0; then break; fi
    sleep 0.2
done

(The first test is needed because Fedora sometimes sets Pid1pid to a blank.) One pass through the loop usually suffices to get a valid Pid1pid.

I cannot explain why a delay is necessary here even after the container has been determined to be "ready" because the test

$Dockerexe exec $Containername sh -c :

has succeeded.

Could you please look into this issue and make an appropriate correction?

Thanks for a great piece of software.

@mviereck
Copy link
Owner

Thank you for reporting!

I cannot explain why a delay is necessary here even after the container has been determined to be "ready" because the test
$Dockerexe exec $Containername sh -c :
has succeeded.

That is odd, indeed. I have made a commit with a repeated check like in your proposal, it should work now. Please try out.

Thanks for a great piece of software.

:-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants