Using RHEL 7.4, GDM 3.22.3
Essentially, my problem is that every time I log out of gnome (as any user,) gdm stops X and starts it on a different display number. This is only really a problem because of some old scripts (which should be updated anyway) that always expect X to be on :0. This is the case when the system starts up and when the first used logs in, but as soon as that user logs out, X :0 is killed and X :1 is started. Viewing the logs in /var/log/gdm, I see that gdm attempted to start X :0 while the previous X :0 was still running, failed, and then started on X :1 instead.
Using strace on gdm, this appears to be a race condition. It looks like one thread sends SIGTERM to the old X, however a separate thread tries to start the new X and fails before the old X is finished terminating (based on a SIGCHILD receipt.) Is there a good way to force gdm to only start X on 0 and retry if it can't? Is there another solution I might be missing?
Update: I have repeated this on Centos 7.4.