Occasionally on reboot I’m not able to open the display. It gets stuck on the splash screen. This specifically seems to happen after pushing an update from Balena. Is there a setting I should change to make sure it kills x windows on start?
Any tips to avoid this issue?
20.03.19 12:35:45 (-0400) frontend (EE)
20.03.19 12:35:45 (-0400) frontend Fatal server error:
20.03.19 12:35:45 (-0400) frontend (EE) Server is already active for display 0
20.03.19 12:35:45 (-0400) frontend If this server is no longer running, remove /tmp/.X0-lock
20.03.19 12:35:45 (-0400) frontend and start again.
20.03.19 12:35:45 (-0400) frontend (EE)
20.03.19 12:35:45 (-0400) frontend (EE)
20.03.19 12:35:45 (-0400) frontend Please consult the The X.Org Foundation support
20.03.19 12:35:45 (-0400) frontend at [http://wiki.x.org](http://wiki.x.org/)
20.03.19 12:35:45 (-0400) frontend for help.
20.03.19 12:35:45 (-0400) frontend (EE)
20.03.19 12:36:00 (-0400) frontend xinit: giving up
20.03.19 12:36:00 (-0400) frontend xinit: unable to connect to X server: Connection refused
20.03.19 12:36:00 (-0400) frontend xinit: server error
Hi,
I was a bit confused since originally you said “on reboot” but later added “seems to happen after pushing an update from Balena”.
Does happen on device reboot, or during container restart (eg after downloading a new release).
Does the issue occur consistently on container restarts? If so, could you try making your container to check whether Xord is already running and connect to it, or kill it and start it again if that’s a better match for you?
Could you share some of the code that you use to spin up Xorg along with any special configuration that you use on your docker-compose?
Please also clarify the exact OS version & device type that this happens.
Could it be a power supply issue, it giving not enough power ? I’ve seen the device being stuck in a certain display states when having power supplies that could not keep up with powering both raspberry pi and the display at the same time. Can you access the device via the terminal while this is happening or is the device as a whole unresponsive ?
@cyplo it’s not a power supply issue. I think I’m not configuring it properly.
The device powers up. Both containers are running. Backend is logging, I can ssh into frontend/backend containers. It just get’s stuck on the balena splash screen, as it is unable to open display 0.
Error message
(EE) Server is already active for display 0
@thgreasi using my dockerfile/sh scripts how would I check the xord is running and properly configure it to make sure that I don’t accidently kill it?
there is nothing that strikes me as wrong in the config you posted.
From what I understand, the server will create this lockfile and write into it the PID of the process that is holding this lock.
In your entrypoint.sh, before launching xinit you could try reading /tmp/.X0-lock. If the file is not there, the error shouldn’t occur. If the file is there and contains a PID you could try ps -p to get more info on what process is acquiring the lock and eventually use the PID to kill it.
Let us know how this goes, we might be able to understand the issue better if we understand how the lockfile is being created.
@dansku Thanks I’ve tried that. It’s not a hardware issue I have 35 Pi’s to work with here
I seem to have a fix for it.
I’m not too familiar with X window system stuff more of a web dev. If I understand the problem properly. The display is blocked by being in use and if it doesn’t properly shut down it creates a lock file to prevent a user from accessing it?
I added
# Remove X lock
sudo rm /tmp/.X0-lock
to the entrypoint file and it seems to have fixed it. I’ve tried rebooting and pushing about 20 times and it looks good here. Is there anything I should be aware of with this?