The prefdm script depends on the entry in /etc/sysconfig/desktop actually reflecting the desktop being run on the system. That is, it presumes that if /etc/sysconfig/desktop contains the line DESKTOP="KDE", then KDE--and kdm--is actually installed. Not always true. For example, I installed Red Hat 6.2 as a KDE workstation, but later decided to 1) use startx instead of having a graphical login, and 2) decided to get rid of KDE in favor of Blackbox, and yet a few months more months down the line, I decided to use Helix GNOME. Up to this point, /etc/sysconfig/desktop still was unchanged, containing the line DESKTOP="KDE", and when I decided to use a graphical login again by changing the runlevel back to 5, prefdm choked, and I didn't get a graphical login screen at all--not a good failsafe. Changing the last few lines of the prefdm script from if [ -n "$preferred" ] && which $preferred >/dev/null 2>&1; then exec `which $preferred` $* fi to if [ -n "$preferred" ] && which $preferred >/dev/null 2>&1; then exec `which $preferred` $* else exec `which xdm` $* fi at least gets me *a* graphical login instead of an error message at a nongraphical login prompt, even if /etc/sysconfig/desktop is messed up. (As a sidenote, changing /etc/sysconfig/desktop so that it read DESKTOP="GNOME" got me the graphical login I wanted, namely gdm, but that's not the point of this report.)
Will be fixed in initscripts-5.48-1.