@imrehg at the end of the start.sh file I do start the xserver in foreground, the next line is a reboot .
reboot
So when I kill the xserver pkill xinit the next line does the reboot.
pkill xinit