I searched in internet and most of the places it was mentioned that there is no /etc/inittab file in Ubuntu because Ubuntu uses /etc/event.d/rc-default file, but when i look in to the file rc-default it is refering to inittab file under etc.
I created inittab file under /etc and copied the same contents provided above. I rebooted the system still it is going to CMD only. Please find the rc-default file contents below.
room1@room1-desktop:/etc$ ls -lrt inittab
-rw-r--r-- 1 root root 1737 2009-06-18 09:52 inittab
room1@room1-desktop:/etc$
room1@room1-desktop:/etc/event.d$ ls -lrt rc-default
-rw-r--r-- 1 root root 485 2008-04-11 19:19 rc-default
room1@room1-desktop:/etc/event.d$
room1@room1-desktop:/etc/event.d$ more rc-default
# rc - runlevel compatibility
#
# This task guesses what the "default runlevel" should be and starts the
# appropriate script.
start on stopped rcS
script
runlevel --reboot || true
if grep -q -w -- "-s\|single\|S" /proc/cmdline; then
telinit S
elif [ -r /etc/inittab ]; then
RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)"
if [ -n "$RL" ]; then
telinit $RL
else
telinit 2
fi
else
telinit 2
fi
end script
room1@room1-desktop:/etc/event.d$
I ran the sed command line present in the rc-default file at the command prompt and it gives the out put as 5. Please find the sed command and its out put below.
room1@room1-desktop:/etc/event.d$ sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab
5
room1@room1-desktop:/etc/event.d$
Please help me to resolve this problem.