Couple of errors in start.sh


#1

Hi - I noticed a couple of faults in start.sh. Both in the “if X isn’t running yet then start it” piece (so possibly not being hit by many people?).

First is that it takes time for the backgrounded startx to get X up and running - the xhost command immediately after “startx&” and the later xset commands all failed on my Pi3 with saying :0.0 couldn’t be found. I added a sleep after startx& and before xhost to get around it, although there’s presumably a better way to wait for X to come up…

Second thing is that the xhost command itself is invalid - it says, “xhost +x” when I think it meant to say “xhost +”.

I’m not sure the xhost command is needed at all, as everything’s running as root anyway - although perhaps that shouldn’t be the case :wink:

This is with 2017-08-16-raspbian-stretch.img (extant in start.sh on the github master at the time of writing)


#2

hi @kevfquinn ,

Thanks for any inputs! For deeper software questions we normally use the Github platform : https://github.com/area515/Photonic3D

Are you familiar with Github? If so you can do make a fork and do a PR to our dev repo which Wes maintains, over here : https://github.com/wesgilster/Photonic3D

any help and PR’s on the project are really appreciated so thanks!


#3

Those commands were based upon some playing around with a linux laptop I had long ago, not sure if they are valid. Instead of using the sleep, the preferred method is to ensure our service is dependent on the runlevel that is dependent on XWindows.

However, I was under the impression that we are already doing that. Feel free to submit a pull request as Robin mentioned.

Here are the docs for LSB:
https://wiki.debian.org/LSBInitScripts

Here is a quick doc on run levels:
http://www.pathbreak.com/blog/ubuntu-startup-init-scripts-runlevels-upstart-jobs-explained

Here is our Service script straight from git: