I was trying to debug my Linux boot process. If I set the default runlevel to 2 or 3, my system hangs without giving me a prompt. I was able to get to runlevel 1 via a kernel parameter, and ran all scripts in
service ***** start/stop commands and it was fine. But if I do a
telinit to runlevel 2 or 3, I can't see my shell prompt. So what is the difference between the two approaches?
I use SysVinit. Content of
/etc/inittab (which I haven't modified):
id:3: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" # agetty on serial port s0:2345:respawn:/sbin/agetty -L -i 9600 ttyS0 vt100 s1:2345:respawn:/sbin/agetty -L -i 9600 ttyS1 vt100 1:2345:respawn:/sbin/agetty 38400 tty1 linux # Run xdm in runlevel 5 x:5:respawn:/etc/X11/prefdm -nodaemon # Ask for password at single user prompt ~~:S:wait:/sbin/sulogin