Reason for gdm in inittab?

If it doesn't fit in another category, ask it here.
Post Reply
wzzrd
Posts: 2
Joined: 2007/06/30 14:56:15
Contact:

Reason for gdm in inittab?

Post by wzzrd » 2007/06/30 15:17:34

I haven't been using CentOS or RHEL (or other RPM-based distro's) for quite some time. I started using CentOS for learning a bit about enterprise class Linux and installed it on my home server. It's pretty nice, but I noticed an oddity: there is no init script for gdm. I looked through this forum and noticed some other people wondering about this too and Google shows even more people having trouble understanding this choice in design.

Most other distro's I know have a script in /etc/init.d for starting and shutting down gdm / xdm / kdm in an easy and clean fashion. CentOS (and I figure the same goes for RHEL) just has a line in /etc/inittab *starting* gdm, so there is no nice and clean way of stopping all gdm processes.

Does anyone know the reason this option was chosen above having an init script? Are there any advantages in this approach I fail to see? How do the rest of you look upon this?

Lenard
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

Reason for gdm in inittab?

Post by Lenard » 2007/06/30 17:09:47

Hmmm..........my RHEL5 systems have:

/etc/inittab;
[code]
#
# inittab This file describes how the INIT process should set up
# the system in a certain run-level.
#
# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
# Modified for RHS Linux by Marc Ewing and Donnie Barnes
#

# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:5:initdefault:

# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# When our UPS tells us power has failed, assume we have a few minutes
# of power left. Schedule a shutdown for 2 minutes from now.
# This does, of course, assume you have powerd installed and your
# UPS connected and working correctly.
pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

# If power was restored before the shutdown kicked in, cancel it.
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"


# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6

# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
[/code]

/etc/X11/prefdm;
[code]
#!/bin/sh

PATH=/sbin:/usr/sbin:/bin:/usr/bin

# shut down any graphical boot that might exist
if [ -x /usr/bin/rhgb-client ]; then
/usr/bin/rhgb-client --quit
fi

# We need to source this so that the login screens get translated
[ -f /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n

# Run preferred X display manager
preferred=
if [ -f /etc/sysconfig/desktop ]; then
. /etc/sysconfig/desktop
if [ "$DISPLAYMANAGER" = GNOME ]; then
preferred=/usr/sbin/gdm
elif [ "$DISPLAYMANAGER" = KDE ]; then
preferred=/usr/bin/kdm
elif [ "$DISPLAYMANAGER" = XDM ]; then
preferred=/usr/bin/xdm
elif [ -n "$DISPLAYMANAGER" ]; then
preferred=$DISPLAYMANAGER
fi
fi

shopt -s execfail

[ -n "$preferred" ] && exec $preferred "$@" >/dev/null 2>&1 </dev/null

# Fallbacks, in order
exec gdm "$@" >/dev/null 2>&1 </dev/null
exec kdm "$@" >/dev/null 2>&1 </dev/null
exec xdm "$@" >/dev/null 2>&1 </dev/null

# catch all exit error
exit 1
[/code]

/etc/sysconfig/desktop;
[code]
DESKTOP="KDE"
DISPLAYMANAGER="KDE"
[/code]

Yes, I prefer KDE over Gnome.

Post Reply

Return to “CentOS 5 - Miscellaneous Questions”