LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Boot in CLI - inittab-wise (https://www.linuxquestions.org/questions/linux-desktop-74/boot-in-cli-inittab-wise-897083/)

ButterflyMelissa 08-13-2011 02:34 AM

Boot in CLI - inittab-wise
 
Hi,

I need to start the system without X11, graphical stuff and such...since this is something I dont really do on a regular base, I'm kinda stuck...
I understand init 3 is the text-only mode (CLI) but...mine starts in 3 already, so, is commenting out the red line enough?

Quote:

#
# /etc/inittab
#

# Runlevels:
# 0 Halt
# 1(S) Single-user
# 2 Not used
# 3 Multi-user
# 4 Not used
# 5 X11
# 6 Reboot

## Only one of the following two lines can be uncommented!
# Boot to console
id:3:initdefault:
# Boot to X11
#id:5:initdefault:

rc::sysinit:/etc/rc.sysinit
rs:S1:wait:/etc/rc.single
rm:2345:wait:/etc/rc.multi
rh:06:wait:/etc/rc.shutdown
su:S:wait:/sbin/sulogin -p

# -8 options fixes umlauts problem on login
c1:2345:respawn:/sbin/agetty -8 -s 38400 tty1 linux
c2:2345:respawn:/sbin/agetty -8 -s 38400 tty2 linux
c3:2345:respawn:/sbin/agetty -8 -s 38400 tty3 linux
c4:2345:respawn:/sbin/agetty -8 -s 38400 tty4 linux
c5:2345:respawn:/sbin/agetty -8 -s 38400 tty5 linux
c6:2345:respawn:/sbin/agetty -8 -s 38400 tty6 linux

# Serial Virtual Console for KVM and others VMs
#s0:2345:respawn:/sbin/agetty -8 -s 9600 ttyS0 linux

# Hypervisor Virtual Console for Xen and KVM
#h0:2345:respawn:/sbin/agetty -8 -s 38400 hvc0 linux

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# Example lines for starting a login manager
x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/usr/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >/dev/null 2>&1

Thanks for some insight!

Thor

tommylovell 08-13-2011 03:25 AM

id:3:initdefault: should be sufficient.

'runlevel' would confirm what runlevel you are running as, but I can't conceive of a situation where you wouldn't be in runlevel 3, unless there is something in your runlevel 3 initialization that issues a init 5 or telinit 5 command.

If you are at runlevel 3, then x:5:respawn:/usr/bin/xdm -nodaemon should not have any effect. It would only be used if you went into runlevel 5.

Is it possible that xdm is being started somewhere in your runlevel 3 initialization? Do other people maintain this system other than you? Do you have any packages installed that might have done something funky like that?

I think Arch is Fedora/RHEL derived (clearly you have System V initialization), so 'chkconfig --list' would show you what is being started at runlevel 3 for services implemented the "recommended way". But no matter how implemented, everything not started by inittab has to be started by /etc/rc.sysinit or a subsequently executed rc shell script. That would mean that (if you are in runlevel 3) all of the "Snnxxxxx" scripts in /etc/rc.d/rc3.d (or /etc/rc3.d). (All of the "Knnxxxxx" scripts get executed first. By convention, they are supposed to be stopping daemons as you are entering that runlevel.) Also check what you have in /etc/rc.d/rc.local (/etc/rc.local).

Try this command, grep -Ri "xdm\|x11" /etc/rc*, to see if there is any funny business going on on your system. I don't expect it to find anything, but you never know.

ps. This is all assuming your system is using the traditional inittab startup. My Fedora15 system is now using 'systemd' for initialization. 'systemd' completely ignores inittab. Look for this softlink to see if you have 'systemd': /etc/systemd/system/default.target

syg00 08-13-2011 03:36 AM

Not worth phaffing around with inittab.
Interrupt grub and add the single character "1" to the end of the kernel line. Gets you into single-user mode for just that boot. Do your business, and either re-boot or use init to switch to the desired new runlevel.

TobiSGD 08-13-2011 03:38 AM

Arch starts its graphical environment with starting a display manager (like GDM, ...) as daemon in your rc.conf, if I remember correctly.

jv2112 08-13-2011 11:48 AM

TobiSGD is dead on. Just open /etc/rc.conf page down to the daemon section and delete gdm. Reboot and you are all set.

ButterflyMelissa 08-13-2011 12:29 PM

@ jv2112

Indeed he is...in fact, putting an exclamation in front of it works just as well, that way I still know where I left my stuff ;) , by the way, i needed that for something else: installing a video card...

Thanks for the heads-up though!

Thor

MrCode 08-13-2011 01:13 PM

Quote:

Originally Posted by jv2112
Just open /etc/rc.conf page down to the daemon section and delete gdm. Reboot and you are all set.

…and this is why Arch's BSD-style init is so awesome (because it's simple). :D

Okay, so that wasn't very constructive, but I need a little more levity in my day…

ButterflyMelissa 08-13-2011 01:21 PM

@ MrCode, hey, we all need this kinda moment...be welcome to this one!

@ tommylovell

Quote:

This is all assuming your system is using the traditional inittab startup. My Fedora15 system is now using 'systemd' for initialization
Well, it seems it does not...that was the confusion all along...Fedora did (does?) use this convention, I remember. Thanks though for the info.


All times are GMT -5. The time now is 02:53 PM.