LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-24-2018, 09:02 AM   #1
EvaJane
LQ Newbie
 
Registered: Aug 2018
Posts: 4

Rep: Reputation: Disabled
Turning off GUI - the method that worked and the 3 that didn't


I'm going through the Introduction to Linux course on edx as it seems just right for my level of dummy. When I got the Lab exercise of turning the GUI off and back on a few things didn't go as the course suggested. I did get it to work and am fairly certain most of the issues will become apparent as I learn more. One, however, is bugging me and I'd really like to know why it is the way it is. The course offers the following ways to turn off the GUI:
student:/tmp> sudo systemctl stop gdm
student:/tmp> sudo systemctl stop lightdm
student:/tmp> sudo telinit 3
student:/tmp> sudo service gdm stop
Of those, only the telinit one works, the gdm just return the prompt and nothing happens, lightdm, apparently, isn't loaded. When starting it back up, all work except the lightdm one(which cannot be found).
And, finally, the question: why do the gdm version work to start it up but not to turn it off?

I'm running Ubuntu 18.04.1 LTS in VirtualBox.

Last edited by EvaJane; 08-31-2018 at 03:23 AM.
 
Old 08-24-2018, 09:23 AM   #2
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,104

Rep: Reputation: 417Reputation: 417Reputation: 417Reputation: 417Reputation: 417
Hi EvaJane,

Welcome to LQ.

From what I can determine, your student documentation is offering you several different possible solutions, but whether or not a given method functions depends on what you have installed (as a Display Manager, for example).

The 1st 2 commands tell the system to stop the display manager service : the first one is valid if you are using Light Display Manager (lightdm), the 2nd one for Gnome Display Manager (gdm). In both cases, it is assumed that the version of linux you are using is running systemd to control services.

The 3rd command is a generic linux command that tells the system to immediately switch to what is called "runlevel" 3 (essentially, a multi-user console session with networking enabled (switching back would be runlevel 5).

The 4th command seems to be to stop Gnome Display Manager other than with the usual systemctl command. I am guessing this is for version of linux that use something other than systemd to manage services.

Hope this helps - please get back to us for any more info.

Last edited by Rickkkk; 08-24-2018 at 09:25 AM.
 
2 members found this post helpful.
Old 08-24-2018, 09:55 AM   #3
EvaJane
LQ Newbie
 
Registered: Aug 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
Wow, that was fast. Greatly appreciate it.
I don't quite understand why neither
sudo systemctl stop gdm
nor
sudo service gdm stop
work when trying to turn it off but both
sudo systemctl start gdm
and
sudo service gdm start
work to turn it back on. It seems a bit odd that the only way to turn it off is telinit...isn't it?
 
Old 08-24-2018, 02:46 PM   #4
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,104

Rep: Reputation: 417Reputation: 417Reputation: 417Reputation: 417Reputation: 417
Hi again EvaJane,

I'm going to hazard a guess here, so please validate on your own.

To begin with, I just did a little test ... I use Arch / Gnome with the LXDM Display manager. I shut down LXDM with :

Code:
sudo systemctl stop lxdm
... it shut down all right ... But the result wasn't very useful. I was brought back to the point during the boot sequence where systemd started lxdm ... I basically had to reboot. I *may* have been able to flip to a different console and start lxdm manually from there - didn't try. Irrespective of that, it is not something I would choose to do again.

I believe that since I have set up my system with the display manager systemd service enabled so it starts automatically at boot, if I stop it as mentioned above, the result will be to bring me back to where the service was started, before login.

If you start your DM manually after already having logged in (somewhat redundant), you will probably be brought back to the command prompt where this command was executed.

In your case, you should check whether gdm is enabled as a service or started manually. Unlike lxdm for me, perhaps gdm prevents users from doing to themselves what I did to myself ...

Again .. this is all speculation.

That said, another way to go to a console while you have a GUI session running is simply to switch consoles (CTRL-ALT-F2 through at least F6) ... You can toggle back and forth (returning to your GUI session is CTRL-ALT-F1).

Hope this helps.

Cheers !
 
2 members found this post helpful.
Old 08-24-2018, 03:19 PM   #5
EvaJane
LQ Newbie
 
Registered: Aug 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
Talking

Oh, wow, OK. I had to read it three times before I understood but, yes, that does make sense. Assuming I did the check right, gdm is enabled as service and most likely preventing me from doing something bad to it. Once it's off though, it has no problem letting me start it up again. That is so cool.

Also. Oh, wow, I'd read about the, erh, they called them Virtual Terminals but didn't quite get what they were and was too chicken to check(why does the same thing have so many names -.-). Figured I was bound to get it eventually. Now I do. Thank you so very much, you have been more than helpful!
 
Old 08-24-2018, 04:06 PM   #6
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,104

Rep: Reputation: 417Reputation: 417Reputation: 417Reputation: 417Reputation: 417
Quote:
Originally Posted by EvaJane View Post
Oh, wow, OK. I had to read it three times before I understood but, yes, that does make sense. Assuming I did the check right, gdm is enabled as service and most likely preventing me from doing something bad to it. Once it's off though, it has no problem letting me start it up again. That is so cool.

Also. Oh, wow, I'd read about the, erh, they called them Virtual Terminals but didn't quite get what they were and was too chicken to check(why does the same thing have so many names -.-). Figured I was bound to get it eventually. Now I do. Thank you so very much, you have been more than helpful!
Happy to help - come back any time.

Cheers !
 
Old 08-25-2018, 05:17 AM   #7
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,093

Rep: Reputation: Disabled
Learning the basics of the Linux system is quite hard, but well worth the effort, glad to see you doing it.

I don't want to preempt your tutorial, but ctrl+alt+F1 is not the usual way to switch back to your GUI from a VT, more likely to be ctrl+alt+F7 - this is because most Linux set up six VTs when they boot up, each accessed by using ctrl+alt+F1~6, & the GUI uses the seventh.

(There can be twelve VTs in a normal Linux set up, but six is the normal.)

Another useful thing to know as a beginner is, ctrl+alt+backspace will exit the GUI, then running startx at the command line will start it back up.

Last edited by fatmac; 08-25-2018 at 05:21 AM.
 
2 members found this post helpful.
Old 08-25-2018, 07:11 AM   #8
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,104

Rep: Reputation: 417Reputation: 417Reputation: 417Reputation: 417Reputation: 417
Quote:
Originally Posted by fatmac View Post
Learning the basics of the Linux system is quite hard, but well worth the effort, glad to see you doing it.

I don't want to preempt your tutorial, but ctrl+alt+F1 is not the usual way to switch back to your GUI from a VT, more likely to be ctrl+alt+F7 - this is because most Linux set up six VTs when they boot up, each accessed by using ctrl+alt+F1~6, & the GUI uses the seventh.

(There can be twelve VTs in a normal Linux set up, but six is the normal.)

Another useful thing to know as a beginner is, ctrl+alt+backspace will exit the GUI, then running startx at the command line will start it back up.
Hey fatmac - thanks for the CTRL-ALT-BACKSPACE tip ... never used that before ...

As to the F-key that brings you back to GUI, I think it must be distro-dependant or DE-dependant. I have used some for which it is F7, as you state, however all of my systems on Arch / LXDE use F1 ...

Cheers to all :-) !
 
Old 08-25-2018, 01:04 PM   #9
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,093

Rep: Reputation: Disabled
You're welcome Rickkkk, likely it is the way that Arch setup their VTs.

(Most distros that I've used tend to set up the first six for command line use, & use the seventh for running the GUI.)
 
1 members found this post helpful.
Old 08-25-2018, 01:48 PM   #10
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 1,709

Rep: Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528
Quote:
Originally Posted by Rickkkk View Post
As to the F-key that brings you back to GUI, I think it must be distro-dependant or DE-dependant. I have used some for which it is F7, as you state, however all of my systems on Arch / LXDE use F1 ...
It absolutely is distro-dependent. Virtually all distros used to use 7 for the GUI. Systemd devs tried to change it to 1, but some distros resisted, and remain on 7, keeping the traditional 1-6 free for shell logins. Systemd (via logind) did manage to change the behavior of startx, which regardless of having been executed on 1, 2, 3, 4, 5 or 6, used to open X on 7, or higher when 7 is occupied by a login manager or open X session. Now it opens on the same on which started.

Last edited by mrmazda; 08-25-2018 at 02:02 PM.
 
2 members found this post helpful.
Old 08-26-2018, 08:17 AM   #11
EvaJane
LQ Newbie
 
Registered: Aug 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
I, uh, want to put the [SOLVED] tag but, uh, I also want y'all to keep talking about stuff.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba worked, and then ... it didn't. What to check? jgibson706 Linux - Software 5 03-08-2016 06:50 AM
Recovery deleted log files at logback worked fine on Windows but didn't work on Linux mjmahmoudi Linux - General 6 05-14-2013 09:09 AM
vnc on Centos 5.7 worked and then didn't after restart frznchckn Linux - Networking 6 11-06-2011 08:36 PM
[SOLVED] Editing lilo.conf didn't worked ? what i did wrong? RazorT4 Linux - Newbie 2 07-20-2010 09:43 AM
Compiz worked then it didn't onthefritz Mandriva 3 11-02-2006 06:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration