Bookwork has Wayland enabled by default.
Only on 4B 2GB and higher, 400, and Pi 5. Others default to X.
So xinit does not work as you have seen.
Run "sudo raspi-config" and choose X11 under "Advancd options->Wayland", then reboot.
Won't make any difference on a lite system with added X. Wayland probably won't be installed. FWIW, my experience with xinit and startx on Bookworm desktop is that it runs fine as long as there is no desktop session (or GUI login manager) already running. Even if the system is set to use Wayland.
@OP:
IIRC there have been issues reported about errors starting X where it has been added to a Bookworm lite installation. You might want to try installing a Bookworm desktop image, setting it to boot to commandline without automatic login, then installing your service.
Statistics: Posted by thagrol — Sun Jan 07, 2024 11:01 am