Welcome to the Linux Foundation Forum!

Please ignore this thread.


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:


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

  • Wicked
    Wicked Posts: 24
    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?
  • kryptikos
    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

    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
    telinit 2
    telinit 2
    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 S30gdm 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/ .

    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'.

    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 :)
  • Wicked
    Wicked Posts: 24
    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 :

    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.

    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:
  • kryptikos
    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

  • deatharte
    Good Day!

    thanks to you Mr. Travon..

    i inspire to experiment with DSL..

    remember this thread?


    i dont care if my terminal would completely destroyed..
    Hehe! :laugh:

    Noob Here... Sorry..
  • Wicked
    Wicked Posts: 24
    Lol its ok Deatharte, Everyone must start at some place. At one point kryptikos was a "newbie" to just like all the other guru's in the community.
    To become one of the great are you willing to accept and conquer any challenge?
  • Wicked
    Wicked Posts: 24
    lol here's a dirty trick I thought to play on a friend that has a linux box.

    Go into the inittab and set the default run level to 6

    shutdown -h now!!!!

    sit back and watch them wonder what the hell is going on...would it work???? would this do infinite loops of reboots?

    Ok I know I'm evil but it would be funny...LOL
  • kryptikos
    lol, well, I will say for my "monkey business" that I did in a training class was this....

    We had a "know it all" about everything. You know the type. No matter what your story is they have something better about the same thing....anyways, this particular person got very annoying, and they didn't lock down their box they were training on. So I just slipped in and added "shutdown now -r" as the last script to run in the init.d runlevel directories. As soon as the box got full up and running, the first thing it did was restart itself. Haha.

    I like a good prank as much as the next person, but that guy just needed to be taken down a notch. It took him and the instructor a while to figure out what was going on. :)
  • Wicked
    lol Yeah good laugh. I'll have to try it someday :D


Upcoming Training