startx will call .xinitrc and then, whatever it is configured in it, i. e. if you have in your .xinitrc startgnome, then, by typing startx, you’re calling .xinitrc and startgnome.
.xinitrc doesn’t have anything to do with DMs, since to run startx you’ve to be already logged in, so, when you used startx, gnome came up because .xinitrc was configured to do that.
From conf.d, you configure xdm to call any DM you want using the DISPLAYMANAGER variable, when it’s installed for the first time (xdm), it’s configured like this:
So, if you want to use gdm instead, you change that line to:
However, if you read the comments about DMs in /etc/conf.d/xdm, you’ll see:
# What display manager do you use ? [ xdm | gdm | kdm | entrance ] # NOTE: If this is set in /etc/rc.conf, that setting will override this one.
And that’s what happen when you edit your rc.conf, setting XSESSION=”Gnome”, the system is instructed to call Gnome the same way you did using .xinitrc regardless the configuration of xdm daemon, if the systems has to use XSESSION=”Gnome”, and nobody has logged in (which wasn’t the case when you used .xinitrc), then, it has to call some DM to ask for login credentials, in this case, called GDM.