Linux.com

Please ignore this thread.

Link to this post 22 Aug 09

Please ignore this thread. I was trying to reply to another thread and hit new thread instead of reply.... Guess I should have zoomed in more on my phone :S


From one new Linux user to another I would just say find any disrto, dive right in and don't be afriad to mess things up, make back ups of every file you edit just incase you screw it up. Give yourself a project and jus go with it, don't stop until it's complete. The more you play with it Linux, the easier it becomes. force yourself to use terminal not GUI. If you have to use it there are ways to toggle between the two.

Personally I love ubuntu server because it forces you to use terminal. it's ugly but after awhile the blinking dot starts to become atractive :P You should add me we can learn with each other

I don't think this penguin is very friendly, it keeps bashing me...:woohoo:

Link to this post 22 Aug 09

Haha, now you have to ask a question to keep this thread going!

:laugh:

Link to this post 23 Aug 09

LOL. Ok just cause you asked..

Ok say someone were to set up an ubuntu server, which is GUI'less(i know thats not a word, but it is now). Then they go and install ubuntu's desktop because they would like to toggle between GUI and Terminal.

Well by doing this it now defaults to GUI every time you reboot your server. How would you get it to boot into terminal instead of GUI? Ubuntu doesnt have an inittab to change the default run level's, so how would you accomplish this?

Link to this post 23 Aug 09

Yeah, I'm not sure why Ubuntu did away with inittab (I know some groups want to use event.d as the new method). That is something worth research, and I might just do that. But either way, they did...they moved everything into /etc/event.d to control their runlevel scripts.

If you look at /etc/event.d, inside that directory is a file called "rc-default"

The code inside says:

# 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

That is telling Ubuntu to enter into runlevel 2 at start up. Sweet...so we now know what runlevel it will boot up to at start, but now how do we kill off the GUI?

Inside the /etc/rc2.d directory (the directory that init will read and start up all scripts listed inside) you'll see the display manager call...usually looks like:

root@kryptikos:/etc/rc2.d# ls
README S20apport S50avahi-daemon S70dns-clean S99laptop-mode
S01policykit S20dkms_autoinstaller S50cups S70pppd-dns S99ondemand
S10acpid S20hotkey-setup S50NetworkManager S89anacron S99rc.local
S10apmd S20powernowd S50pulseaudio S89atd S99rmnologin
S10powernowd.early S20winbind S50rsync S89cron S99stop-readahead
S10sysklogd S24hal S50saned S90binfmt-support
S11klogd S25bluetooth S50system-tools-backends S98usplash
S12dbus [b] S30gdm [/b] S70bootlogs.sh S99acpi-support

If you check the README file in that directory it says to change the "S" to a "K"

The scripts in this directory are executed each time the system enters
this runlevel.

The scripts are all symbolic links whose targets are located in
/etc/init.d/ .

[b]To disable a service in this runlevel, rename its script in this directory
so that the new name begins with a 'K' and a two-digit number, where the
number is the difference between the two-digit number following the 'S'
in its current name, and 100. To re-enable the service, rename the script
back to its original name beginning with 'S'.[/b]

For a more information see /etc/init.d/README.

So the quickest way is to issue the command:

mv /etc/rc2.d/S30gdm /etc/rc2.d/K30gdm

I know that answer is a little longer than probably needed, but it gives a good background :)

Link to this post 23 Aug 09

Nope that answer was perfect. So many people are just quick to give out the code or commands to fix a problem but not really willing to explain how things work or why you do it that way.

I found this thread earlier on how to change it :

Hi,

I know this topic is slightly old, but I think maybe the next generations can learn from this:

lacloai posted this message long time ago:


"Say, if someone wants to use Ubuntu to run for a file server, and she/he only needs to run with full multiuser with network without GUI. That's impossible. Right? Because you can't change it to telinit 1 sine that is single user mode only."

Of course this is not true, and we should not quickly point people to download some magic "runlevel setup helper" tools. The original problem was to avoid loading GUI on boot. It was correctly answered how to change the default runlevel to level 3 under Ubuntu, but then you should only disable the gdm at runlevel 3 in the config files in order to get rid of the hated GUI like this:

1.) cd /etc/rc3.d
2.) sudo mv S30gdm K70gdm

This should do the trick. To get more info why you shall do it like this enter the command "cat /etc/rc3.d/README" and you'll get it.

May the GUI also be added to runlevel 2, you can also disable it in "/etc/rc2.d" like in the example above.

HTH,
Mx
Reply With

Now the guy gives the answer on how to change it without using a "fancy" tool, but unlike yours he doesn't go into detail on why you do it this way.

In other words very well answered.


So... to carry things on, how do you toggle between GUI and Terminal after you have set the default run level to boot into terminal?:cheer:

Link to this post 25 Aug 09

The easiest way I do it is to change the runlevel setting real-time by letting init handle it.

Say I want to jump into the GUI mode (on most Linux distros):

telinit 5

Remember on Ubuntu they do it a little differently. You'd have to check where the SXXgdm script was sitting. Since the default is usually runlevel 2, and runlevel 3 probably starts the SXXgdm scritp you'd tell Ubuntu : telinit 3

To jump back to the regular non GUI:

telinit 3

(or in Ubuntu with your script that has already been controlled from the previous examples of this post): telinit 2

I also reboot the box in this manner or shut it down too:

telinit 6 = reboot
telinit 0 = shutdown

:)

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board